94 lines · 3.8 KB · Text
RawDownload
" When you're writing shell scripts and you are in doubt which test to use," which shell environment variables are defined, what the syntax of the case" statement is, and you need to invoke 'man sh'?"" Your problems are over now!"" Attached is a Vim script file for turning gvim into a shell script editor." It may also be used as an example how to use menus in Vim."" Written by: Lennart Schultz <les@dmi.min.dk> imenu Stmts.for	for  in 
do

doneki	kk0elliimenu Stmts.case	case  in
) ;;
esacbki	k0elliimenu Stmts.if	if   
then

fiki	kk0elliimenu Stmts.if-else	if   
then

else

fiki	kki	kk0elliimenu Stmts.elif	elif   
then

ki	kk0elliimenu Stmts.while	while   
do

doneki	kk0elliimenu Stmts.break	break imenu Stmts.continue	continue imenu Stmts.function	() {

}ki	k0iimenu Stmts.return	return imenu Stmts.return-true	return 0imenu Stmts.return-false	return 1imenu Stmts.exit	exit imenu Stmts.shift	shift imenu Stmts.trap	trap imenu Test.existence	[ -e  ]hiimenu Test.existence - file		[ -f  ]hiimenu Test.existence - file (not empty)	[ -s  ]hiimenu Test.existence - directory	[ -d  ]hiimenu Test.existence - executable	[ -x  ]hiimenu Test.existence - readable	[ -r  ]hiimenu Test.existence - writable	[ -w  ]hiimenu Test.String is empty [ x = "x$" ]hhiimenu Test.String is not empty [ x != "x$" ]hhiimenu Test.Strings is equal [ "" = "" ]hhhhhhhiimenu Test.Strings is not equal [ "" != "" ]hhhhhhhhiimenu Test.Values is greater than [  -gt  ]hhhhhhiimenu Test.Values is greater equal [  -ge  ]hhhhhhiimenu Test.Values is equal [  -eq  ]hhhhhhiimenu Test.Values is not equal [  -ne  ]hhhhhhiimenu Test.Values is less than [  -lt  ]hhhhhhiimenu Test.Values is less equal [  -le  ]hhhhhhiimenu ParmSub.Substitute word if parm not set ${:-}hhiimenu ParmSub.Set parm to word if not set ${:=}hhiimenu ParmSub.Substitute word if parm set else nothing ${:+}hhiimenu ParmSub.If parm not set print word and exit ${:?}hhiimenu SpShVars.Number of positional parameters ${#}imenu SpShVars.All positional parameters (quoted spaces) ${*}imenu SpShVars.All positional parameters (unquoted spaces) ${@}imenu SpShVars.Flags set ${-}imenu SpShVars.Return code of last command ${?}imenu SpShVars.Process number of this shell ${$}imenu SpShVars.Process number of last background command ${!}imenu Environ.HOME ${HOME}imenu Environ.PATH ${PATH}imenu Environ.CDPATH ${CDPATH}imenu Environ.MAIL ${MAIL}imenu Environ.MAILCHECK ${MAILCHECK}imenu Environ.PS1 ${PS1}imenu Environ.PS2 ${PS2}imenu Environ.IFS ${IFS}imenu Environ.SHACCT ${SHACCT}imenu Environ.SHELL ${SHELL}imenu Environ.LC_CTYPE ${LC_CTYPE}imenu Environ.LC_MESSAGES ${LC_MESSAGES}imenu Builtins.cd cdimenu Builtins.echo echoimenu Builtins.eval evalimenu Builtins.exec execimenu Builtins.export exportimenu Builtins.getopts getoptsimenu Builtins.hash hashimenu Builtins.newgrp newgrpimenu Builtins.pwd pwdimenu Builtins.read readimenu Builtins.readonly readonlyimenu Builtins.return returnimenu Builtins.times timesimenu Builtins.type typeimenu Builtins.umask umaskimenu Builtins.wait waitimenu Set.set setimenu Set.unset unsetimenu Set.mark modified or modified variables set -aimenu Set.exit when command returns non-zero exit code set -eimenu Set.Disable file name generation set -fimenu Set.remember function commands set -himenu Set.All keyword arguments are placed in the environment set -kimenu Set.Read commands but do not execute them set -nimenu Set.Exit after reading and executing one command set -timenu Set.Treat unset variables as an error when substituting set -uimenu Set.Print shell input lines as they are read set -vimenu Set.Print commands and their arguments as they are executed set -x