mirror of
https://github.com/vim/vim
synced 2025-07-16 01:01:58 +00:00
updated for version 7.1-295
This commit is contained in:
23
src/vimtutor
23
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
|
||||
|
Reference in New Issue
Block a user