1" Vim syntax file 2" Language: shell (sh) Korn shell (ksh) bash (sh) 3" Maintainer: Charles E. Campbell <[email protected]> 4" Previous Maintainer: Lennart Schultz <[email protected]> 5" Last Change: Dec 11, 2015 6" Version: 143 7" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH 8" For options and settings, please use: :help ft-sh-syntax 9" This file includes many ideas from Eric Brunet ([email protected]) 10 11" For version 5.x: Clear all syntax items {{{1 12" For version 6.x: Quit when a syntax file was already loaded 13if version < 600 14 syntax clear 15elseif exists("b:current_syntax") 16 finish 17endif 18 19" trying to answer the question: which shell is /bin/sh, really? 20" If the user has not specified any of g:is_kornshell, g:is_bash, g:is_posix, g:is_sh, then guess. 21if !exists("g:is_kornshell") && !exists("g:is_bash") && !exists("g:is_posix") && !exists("g:is_sh") 22 let s:shell = "" 23 if executable("/bin/sh") 24 let s:shell = resolve("/bin/sh") 25 elseif executable("/usr/bin/sh") 26 let s:shell = resolve("/usr/bin/sh") 27 endif 28 if s:shell =~ 'bash$' 29 let g:is_bash= 1 30 elseif s:shell =~ 'ksh$' 31 let g:is_kornshell = 1 32 elseif s:shell =~ 'dash$' 33 let g:is_posix = 1 34 endif 35 unlet s:shell 36endif 37 38" handling /bin/sh with is_kornshell/is_sh {{{1 39" b:is_sh is set when "#! /bin/sh" is found; 40" However, it often is just a masquerade by bash (typically Linux) 41" or kornshell (typically workstations with Posix "sh"). 42" So, when the user sets "g:is_bash", "g:is_kornshell", 43" or "g:is_posix", a b:is_sh is converted into b:is_bash/b:is_kornshell, 44" respectively. 45if !exists("b:is_kornshell") && !exists("b:is_bash") 46 if exists("g:is_posix") && !exists("g:is_kornshell") 47 let g:is_kornshell= g:is_posix 48 endif 49 if exists("g:is_kornshell") 50 let b:is_kornshell= 1 51 if exists("b:is_sh") 52 unlet b:is_sh 53 endif 54 elseif exists("g:is_bash") 55 let b:is_bash= 1 56 if exists("b:is_sh") 57 unlet b:is_sh 58 endif 59 else 60 let b:is_sh= 1 61 endif 62endif 63 64" set up default g:sh_fold_enabled {{{1 65" ================================ 66if !exists("g:sh_fold_enabled") 67 let g:sh_fold_enabled= 0 68elseif g:sh_fold_enabled != 0 && !has("folding") 69 let g:sh_fold_enabled= 0 70 echomsg "Ignoring g:sh_fold_enabled=".g:sh_fold_enabled."; need to re-compile vim for +fold support" 71endif 72if !exists("s:sh_fold_functions") 73 let s:sh_fold_functions= and(g:sh_fold_enabled,1) 74endif 75if !exists("s:sh_fold_heredoc") 76 let s:sh_fold_heredoc = and(g:sh_fold_enabled,2) 77endif 78if !exists("s:sh_fold_ifdofor") 79 let s:sh_fold_ifdofor = and(g:sh_fold_enabled,4) 80endif 81if g:sh_fold_enabled && &fdm == "manual" 82 " Given that the user provided g:sh_fold_enabled 83 " AND g:sh_fold_enabled is manual (usual default) 84 " implies a desire for syntax-based folding 85 setl fdm=syntax 86endif 87 88" Set up folding commands for shell {{{1 89" ================================= 90if s:sh_fold_functions 91 com! -nargs=* ShFoldFunctions <args> fold 92else 93 com! -nargs=* ShFoldFunctions <args> 94endif 95if s:sh_fold_heredoc 96 com! -nargs=* ShFoldHereDoc <args> fold 97else 98 com! -nargs=* ShFoldHereDoc <args> 99endif 100if s:sh_fold_ifdofor 101 com! -nargs=* ShFoldIfDoFor <args> fold 102else 103 com! -nargs=* ShFoldIfDoFor <args> 104endif 105 106" sh syntax is case sensitive {{{1 107syn case match 108 109" Clusters: contains=@... clusters {{{1 110"================================== 111syn cluster shErrorList contains=shDoError,shIfError,shInError,shCaseError,shEsacError,shCurlyError,shParenError,shTestError,shOK 112if exists("b:is_kornshell") 113 syn cluster ErrorList add=shDTestError 114endif 115syn cluster shArithParenList contains=shArithmetic,shCaseEsac,shComment,shDeref,shDo,shDerefSimple,shEcho,shEscape,shNumber,shOperator,shPosnParm,shExSingleQuote,shExDoubleQuote,shRedir,shSingleQuote,shDoubleQuote,shStatement,shVariable,shAlias,shTest,shCtrlSeq,shSpecial,shParen,bashSpecialVariables,bashStatement,shIf,shFor 116syn cluster shArithList contains=@shArithParenList,shParenError 117syn cluster shCaseEsacList contains=shCaseStart,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote,shCtrlSeq,@shErrorList,shStringSpecial,shCaseRange 118syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq 119syn cluster shCommandSubList contains=shAlias,shArithmetic,shComment,shCmdParenRegion,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shEcho,shEscape,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shOption,shPosnParm,shSingleQuote,shSpecial,shStatement,shSubSh,shTest,shVariable 120syn cluster shCurlyList contains=shNumber,shComma,shDeref,shDerefSimple,shDerefSpecial 121syn cluster shDblQuoteList contains=shCommandSub,shDeref,shDerefSimple,shEscape,shPosnParm,shCtrlSeq,shSpecial 122syn cluster shDerefList contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError,shDerefPSR,shDerefPPS 123syn cluster shDerefVarList contains=shDerefOp,shDerefVarArray,shDerefOpError 124syn cluster shEchoList contains=shArithmetic,shCommandSub,shDeref,shDerefSimple,shEscape,shExpr,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shCtrlSeq,shEchoQuote 125syn cluster shExprList1 contains=shCharClass,shNumber,shOperator,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shDblBrace,shDeref,shDerefSimple,shCtrlSeq 126syn cluster shExprList2 contains=@shExprList1,@shCaseList,shTest 127syn cluster shFunctionList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shOption,shRedir,shSetList,shSource,shStatement,shVariable,shOperator,shCtrlSeq 128if exists("b:is_kornshell") || exists("b:is_bash") 129 syn cluster shFunctionList add=shRepeat 130 syn cluster shFunctionList add=shDblBrace,shDblParen 131endif 132syn cluster shHereBeginList contains=@shCommandSubList 133syn cluster shHereList contains=shBeginHere,shHerePayload 134syn cluster shHereListDQ contains=shBeginHere,@shDblQuoteList,shHerePayload 135syn cluster shIdList contains=shCommandSub,shWrapLineOperator,shSetOption,shDeref,shDerefSimple,shRedir,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shCtrlSeq,shStringSpecial,shAtExpr 136syn cluster shIfList contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey,shFunctionOne,shFunctionTwo 137syn cluster shLoopList contains=@shCaseList,@shErrorList,shCaseEsac,shConditional,shDblBrace,shExpr,shFor,shForPP,shIf,shOption,shSet,shTest,shTestOpr,shTouch 138syn cluster shSubShList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq,shOperator 139syn cluster shTestList contains=shCharClass,shCommandSub,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shSingleQuote,shTest,shTestOpr 140 141" Echo: {{{1 142" ==== 143" This one is needed INSIDE a CommandSub, so that `echo bla` be correct 144syn region shEcho matchgroup=shStatement start="\<echo\>" skip="\\$" matchgroup=shEchoDelim end="$" matchgroup=NONE end="[<>;&|()`]"me=e-1 end="\d[<>]"me=e-2 end="\s#"me=e-2 contains=@shEchoList skipwhite nextgroup=shQuickComment 145syn region shEcho matchgroup=shStatement start="\<print\>" skip="\\$" matchgroup=shEchoDelim end="$" matchgroup=NONE end="[<>;&|()`]"me=e-1 end="\d[<>]"me=e-2 end="\s#"me=e-2 contains=@shEchoList skipwhite nextgroup=shQuickComment 146syn match shEchoQuote contained '\%(\\\\\)*\\["`'()]' 147 148" This must be after the strings, so that ... \" will be correct 149syn region shEmbeddedEcho contained matchgroup=shStatement start="\<print\>" skip="\\$" matchgroup=shEchoDelim end="$" matchgroup=NONE end="[<>;&|`)]"me=e-1 end="\d[<>]"me=e-2 end="\s#"me=e-2 contains=shNumber,shExSingleQuote,shSingleQuote,shDeref,shDerefSimple,shSpecialVar,shOperator,shExDoubleQuote,shDoubleQuote,shCharClass,shCtrlSeq 150 151" Alias: {{{1 152" ===== 153if exists("b:is_kornshell") || exists("b:is_bash") 154 syn match shStatement "\<alias\>" 155 syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\h[-._[:alnum:]]\+\)\@=" skip="\\$" end="\>\|`" 156 syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\h[-._[:alnum:]]\+=\)\@=" skip="\\$" end="=" 157 158 " Touch: {{{1 159 " ===== 160 syn match shTouch '\<touch\>[^;#]*' skipwhite nextgroup=shTouchList contains=shTouchCmd 161 syn match shTouchCmd '\<touch\>' contained 162endif 163 164" Error Codes: {{{1 165" ============ 166if !exists("g:sh_no_error") 167 syn match shDoError "\<done\>" 168 syn match shIfError "\<fi\>" 169 syn match shInError "\<in\>" 170 syn match shCaseError ";;" 171 syn match shEsacError "\<esac\>" 172 syn match shCurlyError "}" 173 syn match shParenError ")" 174 syn match shOK '\.\(done\|fi\|in\|esac\)' 175 if exists("b:is_kornshell") 176 syn match shDTestError "]]" 177 endif 178 syn match shTestError "]" 179endif 180 181" Options: {{{1 182" ==================== 183syn match shOption "\s\zs[-+][-_a-zA-Z0-9#]\+" 184syn match shOption "\s\zs--[^ \t$`'"|);]\+" 185 186" File Redirection Highlighted As Operators: {{{1 187"=========================================== 188syn match shRedir "\d\=>\(&[-0-9]\)\=" 189syn match shRedir "\d\=>>-\=" 190syn match shRedir "\d\=<\(&[-0-9]\)\=" 191syn match shRedir "\d<<-\=" 192 193" Operators: {{{1 194" ========== 195syn match shOperator "<<\|>>" contained 196syn match shOperator "[!&;|]" contained 197syn match shOperator "\[[[^:]\|\]]" contained 198syn match shOperator "[-=/*+%]\==" skipwhite nextgroup=shPattern 199syn match shPattern "\<\S\+\())\)\@=" contained contains=shExSingleQuote,shSingleQuote,shExDoubleQuote,shDoubleQuote,shDeref 200 201" Subshells: {{{1 202" ========== 203syn region shExpr transparent matchgroup=shExprRegion start="{" end="}" contains=@shExprList2 nextgroup=shMoreSpecial 204syn region shSubSh transparent matchgroup=shSubShRegion start="[^(]\zs(" end=")" contains=@shSubShList nextgroup=shMoreSpecial 205 206" Tests: {{{1 207"======= 208syn region shExpr matchgroup=shRange start="\[" skip=+\\\\\|\\$\|\[+ end="\]" contains=@shTestList,shSpecial 209syn region shTest transparent matchgroup=shStatement start="\<test\s" skip=+\\\\\|\\$+ matchgroup=NONE end="[;&|]"me=e-1 end="$" contains=@shExprList1 210syn region shNoQuote start='\S' skip='\%(\\\\\)*\\.' end='\ze\s' contained 211syn match shTestOpr contained '[^-+/%]\zs=' skipwhite nextgroup=shTestDoubleQuote,shTestSingleQuote,shTestPattern 212syn match shTestOpr contained "<=\|>=\|!=\|==\|=\~\|-.\>\|-\(nt\|ot\|ef\|eq\|ne\|lt\|le\|gt\|ge\)\>\|[!<>]" 213syn match shTestPattern contained '\w\+' 214syn region shTestDoubleQuote contained start='\%(\%(\\\\\)*\\\)\@<!"' skip=+\\\\\|\\"+ end='"' 215syn match shTestSingleQuote contained '\\.' 216syn match shTestSingleQuote contained "'[^']*'" 217if exists("b:is_kornshell") || exists("b:is_bash") 218 syn region shDblBrace matchgroup=Delimiter start="\[\[" skip=+\%(\\\\\)*\\$+ end="\]\]" contains=@shTestList,shNoQuote,shComment 219 syn region shDblParen matchgroup=Delimiter start="((" skip=+\%(\\\\\)*\\$+ end="))" contains=@shTestList,shComment 220endif 221 222" Character Class In Range: {{{1 223" ========================= 224syn match shCharClass contained "\[:\(backspace\|escape\|return\|xdigit\|alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|tab\):\]" 225 226" Loops: do, if, while, until {{{1 227" ====== 228ShFoldIfDoFor syn region shDo transparent matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>" contains=@shLoopList 229ShFoldIfDoFor syn region shIf transparent matchgroup=shConditional start="\<if\_s" matchgroup=shConditional skip=+-fi\>+ end="\<;\_s*then\>" end="\<fi\>" contains=@shIfList 230ShFoldIfDoFor syn region shFor matchgroup=shLoop start="\<for\ze\_s\s*\%(((\)\@!" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn 231ShFoldIfDoFor syn region shForPP matchgroup=shLoop start='\<for\>\_s*((' end='))' contains=shTestOpr 232 233if exists("b:is_kornshell") || exists("b:is_bash") 234 syn cluster shCaseList add=shRepeat 235 syn cluster shFunctionList add=shRepeat 236 syn region shRepeat matchgroup=shLoop start="\<while\_s" end="\<in\_s" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen,shDblBrace 237 syn region shRepeat matchgroup=shLoop start="\<until\_s" end="\<in\_s" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen,shDblBrace 238 syn region shCaseEsac matchgroup=shConditional start="\<select\s" matchgroup=shConditional end="\<in\>" end="\<do\>" contains=@shLoopList 239else 240 syn region shRepeat matchgroup=shLoop start="\<while\_s" end="\<do\>"me=e-2 contains=@shLoopList 241 syn region shRepeat matchgroup=shLoop start="\<until\_s" end="\<do\>"me=e-2 contains=@shLoopList 242endif 243syn region shCurlyIn contained matchgroup=Delimiter start="{" end="}" contains=@shCurlyList 244syn match shComma contained "," 245 246" Case: case...esac {{{1 247" ==== 248syn match shCaseBar contained skipwhite "\(^\|[^\\]\)\(\\\\\)*\zs|" nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote 249syn match shCaseStart contained skipwhite skipnl "(" nextgroup=shCase,shCaseBar 250ShFoldIfDoFor syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="\%(\\.\|[^#$()'" \t]\)\{-}\zs)" end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment 251ShFoldIfDoFor syn region shCaseEsac matchgroup=shConditional start="\<case\>" end="\<esac\>" contains=@shCaseEsacList 252 253syn keyword shCaseIn contained skipwhite skipnl in nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote 254if exists("b:is_bash") 255 syn region shCaseExSingleQuote matchgroup=shQuote start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial skipwhite skipnl nextgroup=shCaseBar contained 256elseif !exists("g:sh_no_error") 257 syn region shCaseExSingleQuote matchgroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained 258endif 259syn region shCaseSingleQuote matchgroup=shQuote start=+'+ end=+'+ contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained 260syn region shCaseDoubleQuote matchgroup=shQuote start=+"+ skip=+\\\\\|\\.+ end=+"+ contains=@shDblQuoteList,shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained 261syn region shCaseCommandSub start=+`+ skip=+\\\\\|\\.+ end=+`+ contains=@shCommandSubList skipwhite skipnl nextgroup=shCaseBar contained 262if exists("b:is_bash") 263 syn region shCaseRange matchgroup=Delimiter start=+\[+ skip=+\\\\+ end=+\]+ contained contains=shCharClass 264 syn match shCharClass '\[:\%(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|word\|or\|xdigit\):\]' contained 265else 266 syn region shCaseRange matchgroup=Delimiter start=+\[+ skip=+\\\\+ end=+\]+ contained 267endif 268" Misc: {{{1 269"====== 270syn match shWrapLineOperator "\\$" 271syn region shCommandSub start="`" skip="\\\\\|\\." end="`" contains=@shCommandSubList 272syn match shEscape contained '\%(^\)\@!\%(\\\\\)*\\.' 273 274" $() and $(()): {{{1 275" $(..) is not supported by sh (Bourne shell). However, apparently 276" some systems (HP?) have as their /bin/sh a (link to) Korn shell 277" (ie. Posix compliant shell). /bin/ksh should work for those 278" systems too, however, so the following syntax will flag $(..) as 279" an Error under /bin/sh. By consensus of vimdev'ers! 280if exists("b:is_kornshell") || exists("b:is_bash") 281 syn region shCommandSub matchgroup=shCmdSubRegion start="\$(" skip='\\\\\|\\.' end=")" contains=@shCommandSubList 282 syn region shArithmetic matchgroup=shArithRegion start="\$((" skip='\\\\\|\\.' end="))" contains=@shArithList 283 syn region shArithmetic matchgroup=shArithRegion start="\$\[" skip='\\\\\|\\.' end="\]" contains=@shArithList 284 syn match shSkipInitWS contained "^\s\+" 285elseif !exists("g:sh_no_error") 286 syn region shCommandSub matchgroup=Error start="\$(" end=")" contains=@shCommandSubList 287endif 288syn region shCmdParenRegion matchgroup=shCmdSubRegion start="(\ze[^(]" skip='\\\\\|\\.' end=")" contains=@shCommandSubList 289 290if exists("b:is_bash") 291 syn cluster shCommandSubList add=bashSpecialVariables,bashStatement 292 syn cluster shCaseList add=bashAdminStatement,bashStatement 293 syn keyword bashSpecialVariables contained auto_resume BASH BASH_ALIASES BASH_ALIASES BASH_ARGC BASH_ARGC BASH_ARGV BASH_ARGV BASH_CMDS BASH_CMDS BASH_COMMAND BASH_COMMAND BASH_ENV BASH_EXECUTION_STRING BASH_EXECUTION_STRING BASH_LINENO BASH_LINENO BASHOPTS BASHOPTS BASHPID BASHPID BASH_REMATCH BASH_REMATCH BASH_SOURCE BASH_SOURCE BASH_SUBSHELL BASH_SUBSHELL BASH_VERSINFO BASH_VERSION BASH_XTRACEFD BASH_XTRACEFD CDPATH COLUMNS COLUMNS COMP_CWORD COMP_CWORD COMP_KEY COMP_KEY COMP_LINE COMP_LINE COMP_POINT COMP_POINT COMPREPLY COMPREPLY COMP_TYPE COMP_TYPE COMP_WORDBREAKS COMP_WORDBREAKS COMP_WORDS COMP_WORDS COPROC COPROC DIRSTACK EMACS EMACS ENV ENV EUID FCEDIT FIGNORE FUNCNAME FUNCNAME FUNCNEST FUNCNEST GLOBIGNORE GROUPS histchars HISTCMD HISTCONTROL HISTFILE HISTFILESIZE HISTIGNORE HISTSIZE HISTTIMEFORMAT HISTTIMEFORMAT HOME HOSTFILE HOSTNAME HOSTTYPE IFS IGNOREEOF INPUTRC LANG LC_ALL LC_COLLATE LC_CTYPE LC_CTYPE LC_MESSAGES LC_NUMERIC LC_NUMERIC LINENO LINES LINES MACHTYPE MAIL MAILCHECK MAILPATH MAPFILE MAPFILE OLDPWD OPTARG OPTERR OPTIND OSTYPE PATH PIPESTATUS POSIXLY_CORRECT POSIXLY_CORRECT PPID PROMPT_COMMAND PS1 PS2 PS3 PS4 PWD RANDOM READLINE_LINE READLINE_LINE READLINE_POINT READLINE_POINT REPLY SECONDS SHELL SHELL SHELLOPTS SHLVL TIMEFORMAT TIMEOUT TMPDIR TMPDIR UID 294 syn keyword bashStatement chmod clear complete du egrep expr fgrep find gnufind gnugrep grep less ls mkdir mv rm rmdir rpm sed sleep sort strip tail 295 syn keyword bashAdminStatement daemon killall killproc nice reload restart start status stop 296 syn keyword bashStatement command compgen 297endif 298 299if exists("b:is_kornshell") 300 syn cluster shCommandSubList add=kshSpecialVariables,kshStatement 301 syn cluster shCaseList add=kshStatement 302 syn keyword kshSpecialVariables contained CDPATH COLUMNS EDITOR ENV ERRNO FCEDIT FPATH HISTFILE HISTSIZE HOME IFS LINENO LINES MAIL MAILCHECK MAILPATH OLDPWD OPTARG OPTIND PATH PPID PS1 PS2 PS3 PS4 PWD RANDOM REPLY SECONDS SHELL TMOUT VISUAL 303 syn keyword kshStatement cat chmod clear cp du egrep expr fgrep find grep killall less ls mkdir mv nice printenv rm rmdir sed sort strip stty tail tput 304 syn keyword kshStatement command setgroups setsenv 305endif 306 307syn match shSource "^\.\s" 308syn match shSource "\s\.\s" 309"syn region shColon start="^\s*:" end="$" end="\s#"me=e-2 contains=@shColonList 310"syn region shColon start="^\s*\zs:" end="$" end="\s#"me=e-2 311syn match shColon '^\s*\zs:' 312 313" String And Character Constants: {{{1 314"================================ 315syn match shNumber "-\=\<\d\+\>#\=" 316syn match shCtrlSeq "\\\d\d\d\|\\[abcfnrtv0]" contained 317if exists("b:is_bash") 318 syn match shSpecial "\\\o\o\o\|\\x\x\x\|\\c[^"]\|\\[abefnrtv]" contained 319endif 320if exists("b:is_bash") 321 syn region shExSingleQuote matchgroup=shQuote start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial 322 syn region shExDoubleQuote matchgroup=shQuote start=+\$"+ skip=+\\\\\|\\.\|\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,shSpecial 323elseif !exists("g:sh_no_error") 324 syn region shExSingleQuote matchGroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial 325 syn region shExDoubleQuote matchGroup=Error start=+\$"+ skip=+\\\\\|\\.+ end=+"+ contains=shStringSpecial 326endif 327syn region shSingleQuote matchgroup=shQuote start=+'+ end=+'+ contains=@Spell 328syn region shDoubleQuote matchgroup=shQuote start=+\%(\%(\\\\\)*\\\)\@<!"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,@Spell 329syn match shStringSpecial "[^[:print:] \t]" contained 330syn match shStringSpecial "\%(\\\\\)*\\[\\"'`$()#]" 331syn match shSpecial "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]" 332syn match shSpecial "^\%(\\\\\)*\\[\\"'`$()#]" 333syn match shMoreSpecial "\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shMoreSpecial contained 334 335" Comments: {{{1 336"========== 337syn cluster shCommentGroup contains=shTodo,@Spell 338syn keyword shTodo contained COMBAK FIXME TODO XXX 339syn match shComment "^\s*\zs#.*$" contains=@shCommentGroup 340syn match shComment "\s\zs#.*$" contains=@shCommentGroup 341syn match shComment contained "#.*$" contains=@shCommentGroup 342syn match shQuickComment contained "#.*$" 343 344" Here Documents: {{{1 345" ========================================= 346if version < 600 347 syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\**END[a-zA-Z_0-9]*\**" matchgroup=shHereDoc01 end="^END[a-zA-Z_0-9]*$" contains=@shDblQuoteList 348 syn region shHereDoc matchgroup=shHereDoc02 start="<<-\s*\**END[a-zA-Z_0-9]*\**" matchgroup=shHereDoc02 end="^\s*END[a-zA-Z_0-9]*$" contains=@shDblQuoteList 349 syn region shHereDoc matchgroup=shHereDoc03 start="<<\s*\**EOF\**" matchgroup=shHereDoc03 end="^EOF$" contains=@shDblQuoteList 350 syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*\**EOF\**" matchgroup=shHereDoc04 end="^\s*EOF$" contains=@shDblQuoteList 351 syn region shHereDoc matchgroup=shHereDoc05 start="<<\s*\**\.\**" matchgroup=shHereDoc05 end="^\.$" contains=@shDblQuoteList 352 syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*\**\.\**" matchgroup=shHereDoc06 end="^\s*\.$" contains=@shDblQuoteList 353 354else 355 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\\\=\z([^ \t|]\+\)" matchgroup=shHereDoc07 end="^\z1\s*$" contains=@shDblQuoteList 356 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<\s*\"\z([^ \t|]\+\)\"" matchgroup=shHereDoc08 end="^\z1\s*$" 357 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<-\s*\z([^ \t|]\+\)" matchgroup=shHereDoc09 end="^\s*\z1\s*$" contains=@shDblQuoteList 358 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*'\z([^ \t|]\+\)'" matchgroup=shHereDoc10 end="^\s*\z1\s*$" 359 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<\s*'\z([^ \t|]\+\)'" matchgroup=shHereDoc11 end="^\z1\s*$" 360 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\"\z([^ \t|]\+\)\"" matchgroup=shHereDoc12 end="^\s*\z1\s*$" 361 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<\s*\\\_$\_s*\z([^ \t|]\+\)" matchgroup=shHereDoc13 end="^\z1\s*$" contains=@shDblQuoteList 362 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\s*\\\_$\_s*'\z([^ \t|]\+\)'" matchgroup=shHereDoc14 end="^\z1\s*$" 363 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<\s*\\\_$\_s*\"\z([^ \t|]\+\)\"" matchgroup=shHereDoc15 end="^\z1\s*$" 364 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\_$\_s*\z([^ \t|]\+\)" matchgroup=shHereDoc16 end="^\s*\z1\s*$" 365 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc17 start="<<-\s*\\\_$\_s*\\\z([^ \t|]\+\)" matchgroup=shHereDoc17 end="^\s*\z1\s*$" 366 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc18 start="<<-\s*\\\_$\_s*'\z([^ \t|]\+\)'" matchgroup=shHereDoc18 end="^\s*\z1\s*$" 367 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc19 start="<<-\s*\\\_$\_s*\"\z([^ \t|]\+\)\"" matchgroup=shHereDoc19 end="^\s*\z1\s*$" 368 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc20 start="<<\\\z([^ \t|]\+\)" matchgroup=shHereDoc20 end="^\z1\s*$" 369 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc21 start="<<-\s*\\\z([^ \t|]\+\)" matchgroup=shHereDoc21 end="^\s*\z1\s*$" 370endif 371 372" Here Strings: {{{1 373" ============= 374" available for: bash; ksh (really should be ksh93 only) but not if its a posix 375if exists("b:is_bash") || (exists("b:is_kornshell") && !exists("g:is_posix")) 376 syn match shRedir "<<<" skipwhite nextgroup=shCmdParenRegion 377endif 378 379" Identifiers: {{{1 380"============= 381syn match shSetOption "\s\zs[-+][a-zA-Z0-9]\+\>" contained 382syn match shVariable "\<\([bwglsav]:\)\=[a-zA-Z0-9.!@_%+,]*\ze=" nextgroup=shVarAssign 383syn match shVarAssign "=" contained nextgroup=shCmdParenRegion,shPattern,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shSingleQuote,shExSingleQuote 384syn region shAtExpr contained start="@(" end=")" contains=@shIdList 385if exists("b:is_bash") 386 syn region shSetList oneline matchgroup=shSet start="\<\(declare\|typeset\|local\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+#\|=" contains=@shIdList 387 syn region shSetList oneline matchgroup=shSet start="\<set\>\ze[^/]" end="\ze[;|)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+=" contains=@shIdList 388elseif exists("b:is_kornshell") 389 syn region shSetList oneline matchgroup=shSet start="\<\(typeset\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList 390 syn region shSetList oneline matchgroup=shSet start="\<set\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList 391else 392 syn region shSetList oneline matchgroup=shSet start="\<\(set\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList 393endif 394 395" Functions: {{{1 396if !exists("g:is_posix") 397 syn keyword shFunctionKey function skipwhite skipnl nextgroup=shFunctionTwo 398endif 399 400if exists("b:is_bash") 401 ShFoldFunctions syn region shFunctionOne matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*{" end="}" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment 402 ShFoldFunctions syn region shFunctionTwo matchgroup=shFunction start="\<[^d][^o]\&\h[-a-zA-Z_0-9]*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment 403 ShFoldFunctions syn region shFunctionThree matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*(" end=")" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment 404 ShFoldFunctions syn region shFunctionFour matchgroup=shFunction start="\<[^d][^o]\&\h[-a-zA-Z_0-9]*\s*\%(()\)\=\_s*)" end=")" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment 405else 406 ShFoldFunctions syn region shFunctionOne matchgroup=shFunction start="^\s*\h\w*\s*()\_s*{" end="}" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment 407 ShFoldFunctions syn region shFunctionTwo matchgroup=shFunction start="\<[^d][^o]\&\h\w*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment 408 ShFoldFunctions syn region shFunctionThree matchgroup=shFunction start="^\s*\h\w*\s*()\_s*(" end=")" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment 409 ShFoldFunctions syn region shFunctionFour matchgroup=shFunction start="\<[^d][^o]\&\h\w*\s*\%(()\)\=\_s*(" end=")" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment 410endif 411 412" Parameter Dereferencing: {{{1 413" ======================== 414if !exists("g:sh_no_error") 415 syn match shDerefWordError "[^}$[]" contained 416endif 417syn match shDerefSimple "\$\%(\k\+\|\d\)" 418syn region shDeref matchgroup=PreProc start="\${" end="}" contains=@shDerefList,shDerefVarArray 419syn match shDerefSimple "\$[-#*@!?]" 420syn match shDerefSimple "\$\$" 421if exists("b:is_bash") || exists("b:is_kornshell") 422 syn region shDeref matchgroup=PreProc start="\${##\=" end="}" contains=@shDerefList 423 syn region shDeref matchgroup=PreProc start="\${\$\$" end="}" contains=@shDerefList 424endif 425 426" ksh: ${!var[*]} array index list syntax: {{{1 427" ======================================== 428if exists("b:is_kornshell") 429 syn region shDeref matchgroup=PreProc start="\${!" end="}" contains=@shDerefVarArray 430endif 431 432" bash: ${!prefix*} and ${#parameter}: {{{1 433" ==================================== 434if exists("b:is_bash") 435 syn region shDeref matchgroup=PreProc start="\${!" end="\*\=}" contains=@shDerefList,shDerefOp 436 syn match shDerefVar contained "{\@<=!\k\+" nextgroup=@shDerefVarList 437endif 438if exists("b:is_kornshell") 439 syn match shDerefVar contained "{\@<=!\k[[:alnum:]_.]*" nextgroup=@shDerefVarList 440endif 441 442syn match shDerefSpecial contained "{\@<=[-*@?0]" nextgroup=shDerefOp,shDerefOpError 443syn match shDerefSpecial contained "\({[#!]\)\@<=[[:alnum:]*@_]\+" nextgroup=@shDerefVarList,shDerefOp 444syn match shDerefVar contained "{\@<=\k\+" nextgroup=@shDerefVarList 445if exists("b:is_kornshell") 446 syn match shDerefVar contained "{\@<=\k[[:alnum:]_.]*" nextgroup=@shDerefVarList 447endif 448 449" sh ksh bash : ${var[... ]...} array reference: {{{1 450syn region shDerefVarArray contained matchgroup=shDeref start="\[" end="]" contains=@shCommandSubList nextgroup=shDerefOp,shDerefOpError 451 452" Special ${parameter OPERATOR word} handling: {{{1 453" sh ksh bash : ${parameter:-word} word is default value 454" sh ksh bash : ${parameter:=word} assign word as default value 455" sh ksh bash : ${parameter:?word} display word if parameter is null 456" sh ksh bash : ${parameter:+word} use word if parameter is not null, otherwise nothing 457" ksh bash : ${parameter#pattern} remove small left pattern 458" ksh bash : ${parameter##pattern} remove large left pattern 459" ksh bash : ${parameter%pattern} remove small right pattern 460" ksh bash : ${parameter%%pattern} remove large right pattern 461" bash : ${parameter^pattern} Case modification 462" bash : ${parameter^^pattern} Case modification 463" bash : ${parameter,pattern} Case modification 464" bash : ${parameter,,pattern} Case modification 465syn cluster shDerefPatternList contains=shDerefPattern,shDerefString 466if !exists("g:sh_no_error") 467 syn match shDerefOpError contained ":[[:punct:]]" 468endif 469syn match shDerefOp contained ":\=[-=?]" nextgroup=@shDerefPatternList 470syn match shDerefOp contained ":\=+" nextgroup=@shDerefPatternList 471if exists("b:is_bash") || exists("b:is_kornshell") 472 syn match shDerefOp contained "#\{1,2}" nextgroup=@shDerefPatternList 473 syn match shDerefOp contained "%\{1,2}" nextgroup=@shDerefPatternList 474 syn match shDerefPattern contained "[^{}]\+" contains=shDeref,shDerefSimple,shDerefPattern,shDerefString,shCommandSub,shDerefEscape nextgroup=shDerefPattern 475 syn region shDerefPattern contained start="{" end="}" contains=shDeref,shDerefSimple,shDerefString,shCommandSub nextgroup=shDerefPattern 476 syn match shDerefEscape contained '\%(\\\\\)*\\.' 477endif 478if exists("b:is_bash") 479 syn match shDerefOp contained "[,^]\{1,2}" nextgroup=@shDerefPatternList 480endif 481syn region shDerefString contained matchgroup=shDerefDelim start=+\%(\\\)\@<!'+ end=+'+ contains=shStringSpecial 482syn region shDerefString contained matchgroup=shDerefDelim start=+\%(\\\)\@<!"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial 483syn match shDerefString contained "\\["']" nextgroup=shDerefPattern 484 485if exists("b:is_bash") 486 " bash : ${parameter:offset} 487 " bash : ${parameter:offset:length} 488 syn region shDerefOp contained start=":[$[:alnum:]_]"me=e-1 end=":"me=e-1 end="}"me=e-1 contains=@shCommandSubList nextgroup=shDerefPOL 489 syn match shDerefPOL contained ":[^}]\+" contains=@shCommandSubList 490 491 " bash : ${parameter//pattern/string} 492 " bash : ${parameter//pattern} 493 syn match shDerefPPS contained '/\{1,2}' nextgroup=shDerefPPSleft 494 syn region shDerefPPSleft contained start='.' skip=@\%(\\\\\)*\\/@ matchgroup=shDerefOp end='/' end='\ze}' nextgroup=shDerefPPSright contains=@shCommandSubList 495 syn region shDerefPPSright contained start='.' skip=@\%(\\\\\)\+@ end='\ze}' contains=@shCommandSubList 496 497 " bash : ${parameter/#substring/replacement} 498 syn match shDerefPSR contained '/#' nextgroup=shDerefPSRleft 499 syn region shDerefPSRleft contained start='.' skip=@\%(\\\\\)*\\/@ matchgroup=shDerefOp end='/' end='\ze}' nextgroup=shDerefPSRright 500 syn region shDerefPSRright contained start='.' skip=@\%(\\\\\)\+@ end='\ze}' 501endif 502 503" Arithmetic Parenthesized Expressions: {{{1 504"syn region shParen matchgroup=shArithRegion start='[^$]\zs(\%(\ze[^(]\|$\)' end=')' contains=@shArithParenList 505syn region shParen matchgroup=shArithRegion start='\$\@!(\%(\ze[^(]\|$\)' end=')' contains=@shArithParenList 506 507" Useful sh Keywords: {{{1 508" =================== 509syn keyword shStatement break cd chdir continue eval exec exit kill newgrp pwd read readonly return shift test trap ulimit umask wait 510syn keyword shConditional contained elif else then 511if !exists("g:sh_no_error") 512 syn keyword shCondError elif else then 513endif 514 515" Useful ksh Keywords: {{{1 516" ==================== 517if exists("b:is_kornshell") || exists("b:is_bash") 518 syn keyword shStatement autoload bg false fc fg functions getopts hash history integer jobs let nohup printf r stop suspend times true type unalias whence 519 if exists("g:is_posix") 520 syn keyword shStatement command 521 else 522 syn keyword shStatement time 523 endif 524 525" Useful bash Keywords: {{{1 526" ===================== 527 if exists("b:is_bash") 528 syn keyword shStatement bind builtin dirs disown enable help local logout popd pushd shopt source 529 else 530 syn keyword shStatement login newgrp 531 endif 532endif 533 534" Synchronization: {{{1 535" ================ 536if !exists("sh_minlines") 537 let sh_minlines = 200 538endif 539if !exists("sh_maxlines") 540 let sh_maxlines = 2 * sh_minlines 541endif 542exec "syn sync minlines=" . sh_minlines . " maxlines=" . sh_maxlines 543syn sync match shCaseEsacSync grouphere shCaseEsac "\<case\>" 544syn sync match shCaseEsacSync groupthere shCaseEsac "\<esac\>" 545syn sync match shDoSync grouphere shDo "\<do\>" 546syn sync match shDoSync groupthere shDo "\<done\>" 547syn sync match shForSync grouphere shFor "\<for\>" 548syn sync match shForSync groupthere shFor "\<in\>" 549syn sync match shIfSync grouphere shIf "\<if\>" 550syn sync match shIfSync groupthere shIf "\<fi\>" 551syn sync match shUntilSync grouphere shRepeat "\<until\>" 552syn sync match shWhileSync grouphere shRepeat "\<while\>" 553 554" Default Highlighting: {{{1 555" ===================== 556hi def link shArithRegion shShellVariables 557hi def link shAtExpr shSetList 558hi def link shBeginHere shRedir 559hi def link shCaseBar shConditional 560hi def link shCaseCommandSub shCommandSub 561hi def link shCaseDoubleQuote shDoubleQuote 562hi def link shCaseIn shConditional 563hi def link shQuote shOperator 564hi def link shCaseSingleQuote shSingleQuote 565hi def link shCaseStart shConditional 566hi def link shCmdSubRegion shShellVariables 567hi def link shColon shComment 568hi def link shDerefOp shOperator 569hi def link shDerefPOL shDerefOp 570hi def link shDerefPPS shDerefOp 571hi def link shDerefPSR shDerefOp 572hi def link shDeref shShellVariables 573hi def link shDerefDelim shOperator 574hi def link shDerefSimple shDeref 575hi def link shDerefSpecial shDeref 576hi def link shDerefString shDoubleQuote 577hi def link shDerefVar shDeref 578hi def link shDoubleQuote shString 579hi def link shEcho shString 580hi def link shEchoDelim shOperator 581hi def link shEchoQuote shString 582hi def link shForPP shLoop 583hi def link shEmbeddedEcho shString 584hi def link shEscape shCommandSub 585hi def link shExDoubleQuote shDoubleQuote 586hi def link shExSingleQuote shSingleQuote 587hi def link shFunction Function 588hi def link shHereDoc shString 589hi def link shHerePayload shHereDoc 590hi def link shLoop shStatement 591hi def link shMoreSpecial shSpecial 592hi def link shNoQuote shDoubleQuote 593hi def link shOption shCommandSub 594hi def link shPattern shString 595hi def link shParen shArithmetic 596hi def link shPosnParm shShellVariables 597hi def link shQuickComment shComment 598hi def link shRange shOperator 599hi def link shRedir shOperator 600hi def link shSetListDelim shOperator 601hi def link shSetOption shOption 602hi def link shSingleQuote shString 603hi def link shSource shOperator 604hi def link shStringSpecial shSpecial 605hi def link shSubShRegion shOperator 606hi def link shTestOpr shConditional 607hi def link shTestPattern shString 608hi def link shTestDoubleQuote shString 609hi def link shTestSingleQuote shString 610hi def link shTouchCmd shStatement 611hi def link shVariable shSetList 612hi def link shWrapLineOperator shOperator 613 614if exists("b:is_bash") 615 hi def link bashAdminStatement shStatement 616 hi def link bashSpecialVariables shShellVariables 617 hi def link bashStatement shStatement 618 hi def link shFunctionParen Delimiter 619 hi def link shFunctionDelim Delimiter 620 hi def link shCharClass shSpecial 621endif 622if exists("b:is_kornshell") 623 hi def link kshSpecialVariables shShellVariables 624 hi def link kshStatement shStatement 625 hi def link shFunctionParen Delimiter 626endif 627 628if !exists("g:sh_no_error") 629 hi def link shCaseError Error 630 hi def link shCondError Error 631 hi def link shCurlyError Error 632 hi def link shDerefError Error 633 hi def link shDerefOpError Error 634 hi def link shDerefWordError Error 635 hi def link shDoError Error 636 hi def link shEsacError Error 637 hi def link shIfError Error 638 hi def link shInError Error 639 hi def link shParenError Error 640 hi def link shTestError Error 641 if exists("b:is_kornshell") 642 hi def link shDTestError Error 643 endif 644endif 645 646hi def link shArithmetic Special 647hi def link shCharClass Identifier 648hi def link shSnglCase Statement 649hi def link shCommandSub Special 650hi def link shComment Comment 651hi def link shConditional Conditional 652hi def link shCtrlSeq Special 653hi def link shExprRegion Delimiter 654hi def link shFunctionKey Function 655hi def link shFunctionName Function 656hi def link shNumber Number 657hi def link shOperator Operator 658hi def link shRepeat Repeat 659hi def link shSet Statement 660hi def link shSetList Identifier 661hi def link shShellVariables PreProc 662hi def link shSpecial Special 663hi def link shStatement Statement 664hi def link shString String 665hi def link shTodo Todo 666hi def link shAlias Identifier 667hi def link shHereDoc01 shRedir 668hi def link shHereDoc02 shRedir 669hi def link shHereDoc03 shRedir 670hi def link shHereDoc04 shRedir 671hi def link shHereDoc05 shRedir 672hi def link shHereDoc06 shRedir 673hi def link shHereDoc07 shRedir 674hi def link shHereDoc08 shRedir 675hi def link shHereDoc09 shRedir 676hi def link shHereDoc10 shRedir 677hi def link shHereDoc11 shRedir 678hi def link shHereDoc12 shRedir 679hi def link shHereDoc13 shRedir 680hi def link shHereDoc14 shRedir 681hi def link shHereDoc15 shRedir 682hi def link shHereDoc16 shRedir 683hi def link shHereDoc17 shRedir 684hi def link shHereDoc18 shRedir 685hi def link shHereDoc19 shRedir 686hi def link shHereDoc20 shRedir 687hi def link shHereDoc21 shRedir 688 689" Delete shell folding commands {{{1 690" ============================= 691delc ShFoldFunctions 692delc ShFoldHereDoc 693delc ShFoldIfDoFor 694 695" Set Current Syntax: {{{1 696" =================== 697if exists("b:is_bash") 698 let b:current_syntax = "bash" 699elseif exists("b:is_kornshell") 700 let b:current_syntax = "ksh" 701else 702 let b:current_syntax = "sh" 703endif 704 705" vim: ts=16 fdm=marker 706