comparison src/vimtutor @ 25700:d4faa2c5211b

Update runtime files Commit: https://github.com/vim/vim/commit/89a9c159f23fb7b3e24e6d09068adfc24a73afcb Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 29 21:55:35 2021 +0200 Update runtime files
author Bram Moolenaar <Bram@vim.org>
date Sun, 29 Aug 2021 22:00:05 +0200
parents 5eac31544dd0
children
comparison
equal deleted inserted replaced
25699:8088e687c3d7 25700:d4faa2c5211b
1 #! /bin/sh 1 #!/bin/sh
2 2
3 # Start Vim on a copy of the tutor file. 3 # Start Vim on a copy of the tutor file.
4 4
5 # Usage: vimtutor [-g] [xx] 5 # Usage: vimtutor [-g] [xx]
6 # Where optional argument -g starts vimtutor in gvim (GUI) instead of vim. 6 # Where optional argument -g starts vimtutor in gvim (GUI) instead of vim.
11 11
12 # Vim could be called "vim" or "vi". Also check for "vimN", for people who 12 # Vim could be called "vim" or "vi". Also check for "vimN", for people who
13 # have Vim installed with its version number. 13 # have Vim installed with its version number.
14 # We anticipate up to a future Vim 8.1 version :-). 14 # We anticipate up to a future Vim 8.1 version :-).
15 seq="vim vim81 vim80 vim8 vim74 vim73 vim72 vim71 vim70 vim7 vim6 vi" 15 seq="vim vim81 vim80 vim8 vim74 vim73 vim72 vim71 vim70 vim7 vim6 vi"
16 if test "$1" = "-g"; then 16 if test "$1" = "-g"; then
17 # Try to use the GUI version of Vim if possible, it will fall back 17 # Try to use the GUI version of Vim if possible, it will fall back
18 # on Vim if Gvim is not installed. 18 # on Vim if Gvim is not installed.
19 seq="gvim gvim81 gvim80 gvim8 gvim74 gvim73 gvim72 gvim71 gvim70 gvim7 gvim6 $seq" 19 seq="gvim gvim81 gvim80 gvim8 gvim74 gvim73 gvim72 gvim71 gvim70 gvim7 gvim6 $seq"
20 shift 20 shift
21 fi 21 fi
22 22
23 xx=$1 23 xx=$1
24 export xx 24 export xx
25 25
51 51
52 # remove the copy of the tutor on exit 52 # remove the copy of the tutor on exit
53 trap "rm -rf $TODELETE" 0 1 2 3 9 11 13 15 53 trap "rm -rf $TODELETE" 0 1 2 3 9 11 13 15
54 54
55 for i in $seq; do 55 for i in $seq; do
56 testvim=`which $i 2>/dev/null` 56 testvim=$(which $i 2>/dev/null)
57 if test -f "$testvim"; then 57 if test -f "$testvim"; then
58 VIM=$i 58 VIM=$i
59 break 59 break
60 fi 60 fi
61 done 61 done
62 62
63 # When no Vim version was found fall back to "vim", you'll get an error message 63 # When no Vim version was found fall back to "vim", you'll get an error message
64 # below. 64 # below.
65 if test -z "$VIM"; then 65 if test -z "$VIM"; then
66 VIM=vim 66 VIM=vim
67 fi 67 fi
68 68
69 # Use Vim to copy the tutor, it knows the value of $VIMRUNTIME 69 # Use Vim to copy the tutor, it knows the value of $VIMRUNTIME
70 # The script tutor.vim tells Vim which file to copy 70 # The script tutor.vim tells Vim which file to copy
71 $VIM -f -u NONE -c 'so $VIMRUNTIME/tutor/tutor.vim' 71 $VIM -f -u NONE -c 'so $VIMRUNTIME/tutor/tutor.vim'
72 72
73 # Start vim without any .vimrc, set 'nocompatible' and 'showcmd' 73 # Start vim without any .vimrc, set 'nocompatible' and 'showcmd'
74 $VIM -f -u NONE -c "set nocp showcmd" $TUTORCOPY 74 $VIM -f -u NONE -c "set nocp showcmd" "$TUTORCOPY"