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 (
14 call :test_dir_writable "%~dpf0" %%d
15 IF NOT ERRORLEVEL 1 GOTO dir_ok
18 echo No working directory is found
22 SET TUTORCOPY=%2\$tutor$
23 COPY %1 %TUTORCOPY% >nul 2>nul
30 IF NOT .%1==.-console GOTO use_gui
36 :: Try making a copy of tutor with gvim. If gvim cannot be found, try using
37 :: vim instead. If vim cannot be found, alert user to check environment and
40 :: The script tutor.vim tells Vim which file to copy.
41 start "dummy" /b /w "%~dp0gvim.exe" -u NONE -c "so $VIMRUNTIME/tutor/tutor.vim"
42 IF ERRORLEVEL 1 GOTO use_vim
44 :: Start gvim without any .vimrc, set 'nocompatible'
45 start "dummy" /b /w "%~dp0gvim.exe" -u NONE -c "set nocp" %TUTORCOPY%
50 :: The script tutor.vim tells Vim which file to copy
51 call vim -u NONE -c "so $VIMRUNTIME/tutor/tutor.vim"
52 IF ERRORLEVEL 1 GOTO no_executable
54 :: Start vim without any .vimrc, set 'nocompatible'
55 call vim -u NONE -c "set nocp" %TUTORCOPY%
62 ECHO No vim or gvim found in current directory or PATH.
63 ECHO Check your installation or re-run install.exe
66 :: remove the copy of the tutor
67 IF EXIST %TUTORCOPY% DEL %TUTORCOPY%