Mercurial > vim
annotate vimtutor.bat @ 16150:b23048205589 v8.1.1080
patch 8.1.1080: when a screendump test fails, moving the file is a hassle
commit https://github.com/vim/vim/commit/ef7f0e367eeaf6fb31b1caa0e3de1a4b07e86af3
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 30 15:59:51 2019 +0100
patch 8.1.1080: when a screendump test fails, moving the file is a hassle
Problem: When a screendump test fails, moving the file is a hassle.
Solution: Instead of appending ".failed" to the file name, keep the same
file name but put the screendump in the "failed" directory.
Then the file name only needs to be typed once when moving a
screendump.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 30 Mar 2019 16:00:06 +0100 |
parents | 1b154b5f247d |
children | 831a3f3be6f4 |
rev | line source |
---|---|
7 | 1 :: Start Vim on a copy of the tutor file. |
2 @echo off | |
3 | |
4 :: Usage: vimtutor [-console] [xx] | |
5 :: | |
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. | |
11 | |
12 :: Use Vim to copy the tutor, it knows the value of $VIMRUNTIME | |
13113
1b154b5f247d
patch 8.0.1431: MS-Windows: vimtutor fails if %TMP% has special chars
Christian Brabandt <cb@256bit.org>
parents:
12485
diff
changeset
|
13 FOR %%d in (. "%TMP%" "%TEMP%") DO IF EXIST %%d\nul SET TUTORCOPY=%%d\$tutor$ |
7 | 14 |
15 SET xx=%1 | |
16 | |
17 IF NOT .%1==.-console GOTO use_gui | |
18 SHIFT | |
19 SET xx=%1 | |
20 GOTO use_vim | |
21 :use_gui | |
22 | |
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 | |
25 :: installation. | |
26 | |
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 | |
30 | |
31 start /w gvim -u NONE -c "so $VIMRUNTIME/tutor/tutor.vim" | |
32 IF ERRORLEVEL 1 GOTO use_vim | |
33 | |
34 :: Start gvim without any .vimrc, set 'nocompatible' | |
35 start /w gvim -u NONE -c "set nocp" %TUTORCOPY% | |
36 | |
37 GOTO end | |
38 | |
39 :ntaction | |
40 start "dummy" /b /w gvim -u NONE -c "so $VIMRUNTIME/tutor/tutor.vim" | |
41 IF ERRORLEVEL 1 GOTO use_vim | |
42 | |
43 :: Start gvim without any .vimrc, set 'nocompatible' | |
44 start "dummy" /b /w gvim -u NONE -c "set nocp" %TUTORCOPY% | |
45 | |
46 GOTO end | |
47 | |
48 :use_vim | |
49 :: The script tutor.vim tells Vim which file to copy | |
12485
ab40ecb0fd73
patch 8.0.1122: vimtutor.bat doesn't work well with vim.bat
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
50 call vim -u NONE -c "so $VIMRUNTIME/tutor/tutor.vim" |
7 | 51 IF ERRORLEVEL 1 GOTO no_executable |
52 | |
53 :: Start vim without any .vimrc, set 'nocompatible' | |
12485
ab40ecb0fd73
patch 8.0.1122: vimtutor.bat doesn't work well with vim.bat
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
54 call vim -u NONE -c "set nocp" %TUTORCOPY% |
7 | 55 |
56 GOTO end | |
57 | |
58 :no_executable | |
59 ECHO. | |
60 ECHO. | |
61 ECHO No vim or gvim found in current directory or PATH. | |
62 ECHO Check your installation or re-run install.exe | |
63 | |
64 :end | |
65 :: remove the copy of the tutor | |
66 IF EXIST %TUTORCOPY% DEL %TUTORCOPY% | |
67 SET xx= |