1 :: Start Vim on a copy of the tutor file.
4 :: Usage: vimtutor [-console] [xx]
6 :: -console means gvim will not be used
7 :: xx is a language code like "es" or "nl".
8 :: When an xx argument is given, it tries loading that tutor.
9 :: When this fails or no xx argument was given, it tries using 'v:lang'
10 :: When that also fails, it uses the English version.
12 :: Use Vim to copy the tutor, it knows the value of $VIMRUNTIME
13 FOR %%d in (. %TMP% %TEMP%) DO IF EXIST %%d\nul SET TUTORCOPY=%%d\$tutor$
17 IF NOT .%1==.-console GOTO use_gui
23 :: Try making a copy of tutor with gvim. If gvim cannot be found, try using
24 :: vim instead. If vim cannot be found, alert user to check environment and
27 :: The script tutor.vim tells Vim which file to copy.
28 :: For Windows NT "start" works a bit differently.
29 IF .%OS%==.Windows_NT GOTO ntaction
31 start /w gvim -u NONE -c "so $VIMRUNTIME/tutor/tutor.vim"
32 IF ERRORLEVEL 1 GOTO use_vim
34 :: Start gvim without any .vimrc, set 'nocompatible'
35 start /w gvim -u NONE -c "set nocp" %TUTORCOPY%
40 start "dummy" /b /w gvim -u NONE -c "so $VIMRUNTIME/tutor/tutor.vim"
41 IF ERRORLEVEL 1 GOTO use_vim
43 :: Start gvim without any .vimrc, set 'nocompatible'
44 start "dummy" /b /w gvim -u NONE -c "set nocp" %TUTORCOPY%
49 :: The script tutor.vim tells Vim which file to copy
50 vim -u NONE -c "so $VIMRUNTIME/tutor/tutor.vim"
51 IF ERRORLEVEL 1 GOTO no_executable
53 :: Start vim without any .vimrc, set 'nocompatible'
54 vim -u NONE -c "set nocp" %TUTORCOPY%
61 ECHO No vim or gvim found in current directory or PATH.
62 ECHO Check your installation or re-run install.exe
65 :: remove the copy of the tutor
66 IF EXIST %TUTORCOPY% DEL %TUTORCOPY%