annotate runtime/tutor/vimtutor.bat @ 1622:149d8b46404c

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