1" When you're writing shell scripts and you are in doubt which test to use, 2" which shell environment variables are defined, what the syntax of the case 3" statement is, and you need to invoke 'man sh'? 4" 5" Your problems are over now! 6" 7" Attached is a Vim script file for turning gvim into a shell script editor. 8" It may also be used as an example how to use menus in Vim. 9" 10" Written by: Lennart Schultz <les@dmi.min.dk> 11 12imenu Stmts.for for in 13do 14 15doneki kk0elli 16imenu Stmts.case case in 17) ;; 18esacbki k0elli 19imenu Stmts.if if 20then 21 22fiki kk0elli 23imenu Stmts.if-else if 24then 25 26else 27 28fiki kki kk0elli 29imenu Stmts.elif elif 30then 31 32ki kk0elli 33imenu Stmts.while while 34do 35 36doneki kk0elli 37imenu Stmts.break break 38imenu Stmts.continue continue 39imenu Stmts.function () { 40 41}ki k0i 42imenu Stmts.return return 43imenu Stmts.return-true return 0 44imenu Stmts.return-false return 1 45imenu Stmts.exit exit 46imenu Stmts.shift shift 47imenu Stmts.trap trap 48imenu Test.existence [ -e ]hi 49imenu Test.existence - file [ -f ]hi 50imenu Test.existence - file (not empty) [ -s ]hi 51imenu Test.existence - directory [ -d ]hi 52imenu Test.existence - executable [ -x ]hi 53imenu Test.existence - readable [ -r ]hi 54imenu Test.existence - writable [ -w ]hi 55imenu Test.String is empty [ x = "x$" ]hhi 56imenu Test.String is not empty [ x != "x$" ]hhi 57imenu Test.Strings is equal [ "" = "" ]hhhhhhhi 58imenu Test.Strings is not equal [ "" != "" ]hhhhhhhhi 59imenu Test.Values is greater than [ -gt ]hhhhhhi 60imenu Test.Values is greater equal [ -ge ]hhhhhhi 61imenu Test.Values is equal [ -eq ]hhhhhhi 62imenu Test.Values is not equal [ -ne ]hhhhhhi 63imenu Test.Values is less than [ -lt ]hhhhhhi 64imenu Test.Values is less equal [ -le ]hhhhhhi 65imenu ParmSub.Substitute word if parm not set ${:-}hhi 66imenu ParmSub.Set parm to word if not set ${:=}hhi 67imenu ParmSub.Substitute word if parm set else nothing ${:+}hhi 68imenu ParmSub.If parm not set print word and exit ${:?}hhi 69imenu SpShVars.Number of positional parameters ${#} 70imenu SpShVars.All positional parameters (quoted spaces) ${*} 71imenu SpShVars.All positional parameters (unquoted spaces) ${@} 72imenu SpShVars.Flags set ${-} 73imenu SpShVars.Return code of last command ${?} 74imenu SpShVars.Process number of this shell ${$} 75imenu SpShVars.Process number of last background command ${!} 76imenu Environ.HOME ${HOME} 77imenu Environ.PATH ${PATH} 78imenu Environ.CDPATH ${CDPATH} 79imenu Environ.MAIL ${MAIL} 80imenu Environ.MAILCHECK ${MAILCHECK} 81imenu Environ.PS1 ${PS1} 82imenu Environ.PS2 ${PS2} 83imenu Environ.IFS ${IFS} 84imenu Environ.SHACCT ${SHACCT} 85imenu Environ.SHELL ${SHELL} 86imenu Environ.LC_CTYPE ${LC_CTYPE} 87imenu Environ.LC_MESSAGES ${LC_MESSAGES} 88imenu Builtins.cd cd 89imenu Builtins.echo echo 90imenu Builtins.eval eval 91imenu Builtins.exec exec 92imenu Builtins.export export 93imenu Builtins.getopts getopts 94imenu Builtins.hash hash 95imenu Builtins.newgrp newgrp 96imenu Builtins.pwd pwd 97imenu Builtins.read read 98imenu Builtins.readonly readonly 99imenu Builtins.return return 100imenu Builtins.times times 101imenu Builtins.type type 102imenu Builtins.umask umask 103imenu Builtins.wait wait 104imenu Set.set set 105imenu Set.unset unset 106imenu Set.mark modified or modified variables set -a 107imenu Set.exit when command returns non-zero exit code set -e 108imenu Set.Disable file name generation set -f 109imenu Set.remember function commands set -h 110imenu Set.All keyword arguments are placed in the environment set -k 111imenu Set.Read commands but do not execute them set -n 112imenu Set.Exit after reading and executing one command set -t 113imenu Set.Treat unset variables as an error when substituting set -u 114imenu Set.Print shell input lines as they are read set -v 115imenu Set.Print commands and their arguments as they are executed set -x 116