summaryrefslogtreecommitdiff
path: root/src/vimtutor
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2008-05-07 15:40:33 +0000
committerBram Moolenaar <Bram@vim.org>2008-05-07 15:40:33 +0000
commit2b57078d735b72fdbfa70eb9fcad1a4c1800f959 (patch)
tree97a834843125b68360f1cbfe2dee13e665a8a074 /src/vimtutor
parenta9aafe5c3106b526926f435fd83aea66706ba6d4 (diff)
downloadvim-git-2b57078d735b72fdbfa70eb9fcad1a4c1800f959.tar.gz
updated for version 7.1-295v7.1.295
Diffstat (limited to 'src/vimtutor')
-rwxr-xr-xsrc/vimtutor23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/vimtutor b/src/vimtutor
index 731b1ef23..70d9ec741 100755
--- a/src/vimtutor
+++ b/src/vimtutor
@@ -2,11 +2,24 @@
# Start Vim on a copy of the tutor file.
-# Usage: vimtutor [xx], where xx is a language code like "es" or "nl".
+# Usage: vimtutor [-g] [xx]
+# Where optional argument -g starts vimtutor in gvim (GUI) instead of vim.
+# and xx is a language code like "es" or "nl".
# When an argument is given, it tries loading that tutor.
# When this fails or no argument was given, it tries using 'v:lang'
# When that also fails, it uses the English version.
+# Vim could be called "vim" or "vi". Also check for "vimN", for people who
+# have Vim installed with its version number.
+# We anticipate up to a future Vim 8 version :-).
+seq="vim vim8 vim75 vim74 vim73 vim72 vim71 vim70 vim7 vim6 vi"
+if test "$1" = "-g"; then
+ # Try to use the GUI version of Vim if possible, it will fall back
+ # on Vim if Gvim is not installed.
+ seq="gvim gvim8 gvim75 gvim74 gvim73 gvim72 gvim71 gvim70 gvim7 gvim6 $seq"
+ shift
+fi
+
xx=$1
export xx
@@ -39,10 +52,6 @@ export TUTORCOPY
# remove the copy of the tutor on exit
trap "rm -rf $TODELETE" 0 1 2 3 9 11 13 15
-# Vim could be called "vim" or "vi". Also check for "vimN", for people who
-# have Vim installed with its version number.
-# We anticipate up to a future Vim 8 version :-).
-seq="vim vim8 vim75 vim74 vim73 vim72 vim71 vim70 vim7 vim6 vi"
for i in $seq; do
testvim=`which $i 2>/dev/null`
if test -f "$testvim"; then
@@ -59,7 +68,7 @@ fi
# Use Vim to copy the tutor, it knows the value of $VIMRUNTIME
# The script tutor.vim tells Vim which file to copy
-$VIM -u NONE -c 'so $VIMRUNTIME/tutor/tutor.vim'
+$VIM -f -u NONE -c 'so $VIMRUNTIME/tutor/tutor.vim'
# Start vim without any .vimrc, set 'nocompatible'
-$VIM -u NONE -c "set nocp" $TUTORCOPY
+$VIM -f -u NONE -c "set nocp" $TUTORCOPY