annotate vimtutor.bat @ 282:33d9c918b8ab

updated for version 7.0075
author vimboss
date Sun, 22 May 2005 22:07:59 +0000
parents 3fc0f57ecb91
children ab40ecb0fd73
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 :: Start Vim on a copy of the tutor file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 @echo off
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 :: Usage: vimtutor [-console] [xx]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 ::
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 :: -console means gvim will not be used
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 :: xx is a language code like "es" or "nl".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 :: When an xx argument is given, it tries loading that tutor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 :: When this fails or no xx argument was given, it tries using 'v:lang'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 :: When that also fails, it uses the English version.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 :: Use Vim to copy the tutor, it knows the value of $VIMRUNTIME
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 FOR %%d in (. %TMP% %TEMP%) DO IF EXIST %%d\nul SET TUTORCOPY=%%d\$tutor$
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 SET xx=%1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 IF NOT .%1==.-console GOTO use_gui
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 SHIFT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 SET xx=%1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 GOTO use_vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 :use_gui
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 :: Try making a copy of tutor with gvim. If gvim cannot be found, try using
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 :: vim instead. If vim cannot be found, alert user to check environment and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 :: installation.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 :: The script tutor.vim tells Vim which file to copy.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 :: For Windows NT "start" works a bit differently.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 IF .%OS%==.Windows_NT GOTO ntaction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 start /w gvim -u NONE -c "so $VIMRUNTIME/tutor/tutor.vim"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 IF ERRORLEVEL 1 GOTO use_vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 :: Start gvim without any .vimrc, set 'nocompatible'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 start /w gvim -u NONE -c "set nocp" %TUTORCOPY%
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 GOTO end
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 :ntaction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 start "dummy" /b /w gvim -u NONE -c "so $VIMRUNTIME/tutor/tutor.vim"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 IF ERRORLEVEL 1 GOTO use_vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 :: Start gvim without any .vimrc, set 'nocompatible'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 start "dummy" /b /w gvim -u NONE -c "set nocp" %TUTORCOPY%
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 GOTO end
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 :use_vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 :: The script tutor.vim tells Vim which file to copy
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 vim -u NONE -c "so $VIMRUNTIME/tutor/tutor.vim"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 IF ERRORLEVEL 1 GOTO no_executable
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 :: Start vim without any .vimrc, set 'nocompatible'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 vim -u NONE -c "set nocp" %TUTORCOPY%
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 GOTO end
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 :no_executable
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 ECHO.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 ECHO.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 ECHO No vim or gvim found in current directory or PATH.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 ECHO Check your installation or re-run install.exe
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 :end
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 :: remove the copy of the tutor
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 IF EXIST %TUTORCOPY% DEL %TUTORCOPY%
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 SET xx=