xref: /vim-8.2.3635/runtime/syntax/sh.vim (revision 03413f44)
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:		Apr 11, 2016
6" Version:		147
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 the syntax-highlighting iskeyword
89if has("patch-7.4.1141")
90 exe "syn iskeyword ".&iskeyword.",-"
91endif
92
93" Set up folding commands for shell {{{1
94" =================================
95if s:sh_fold_functions
96 com! -nargs=* ShFoldFunctions <args> fold
97else
98 com! -nargs=* ShFoldFunctions <args>
99endif
100if s:sh_fold_heredoc
101 com! -nargs=* ShFoldHereDoc <args> fold
102else
103 com! -nargs=* ShFoldHereDoc <args>
104endif
105if s:sh_fold_ifdofor
106 com! -nargs=* ShFoldIfDoFor <args> fold
107else
108 com! -nargs=* ShFoldIfDoFor <args>
109endif
110
111" sh syntax is case sensitive {{{1
112syn case match
113
114" Clusters: contains=@... clusters {{{1
115"==================================
116syn cluster shErrorList	contains=shDoError,shIfError,shInError,shCaseError,shEsacError,shCurlyError,shParenError,shTestError,shOK
117if exists("b:is_kornshell")
118 syn cluster ErrorList add=shDTestError
119endif
120syn 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
121syn cluster shArithList	contains=@shArithParenList,shParenError
122syn cluster shCaseEsacList	contains=shCaseStart,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote,shCtrlSeq,@shErrorList,shStringSpecial,shCaseRange
123syn cluster shCaseList	contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq
124syn 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
125syn cluster shCurlyList	contains=shNumber,shComma,shDeref,shDerefSimple,shDerefSpecial
126syn cluster shDblQuoteList	contains=shCommandSub,shDeref,shDerefSimple,shEscape,shPosnParm,shCtrlSeq,shSpecial
127syn cluster shDerefList	contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError,shDerefPSR,shDerefPPS
128syn cluster shDerefVarList	contains=shDerefOp,shDerefVarArray,shDerefOpError
129syn cluster shEchoList	contains=shArithmetic,shCommandSub,shDeref,shDerefSimple,shEscape,shExpr,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shCtrlSeq,shEchoQuote
130syn cluster shExprList1	contains=shCharClass,shNumber,shOperator,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shDblBrace,shDeref,shDerefSimple,shCtrlSeq
131syn cluster shExprList2	contains=@shExprList1,@shCaseList,shTest
132syn cluster shFunctionList	contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shOption,shRedir,shSetList,shSource,shStatement,shVariable,shOperator,shCtrlSeq
133if exists("b:is_kornshell") || exists("b:is_bash")
134 syn cluster shFunctionList	add=shRepeat
135 syn cluster shFunctionList	add=shDblBrace,shDblParen
136endif
137syn cluster shHereBeginList	contains=@shCommandSubList
138syn cluster shHereList	contains=shBeginHere,shHerePayload
139syn cluster shHereListDQ	contains=shBeginHere,@shDblQuoteList,shHerePayload
140syn cluster shIdList	contains=shCommandSub,shWrapLineOperator,shSetOption,shDeref,shDerefSimple,shRedir,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shCtrlSeq,shStringSpecial,shAtExpr
141syn cluster shIfList	contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey,shFunctionOne,shFunctionTwo
142syn cluster shLoopList	contains=@shCaseList,@shErrorList,shCaseEsac,shConditional,shDblBrace,shExpr,shFor,shForPP,shIf,shOption,shSet,shTest,shTestOpr,shTouch
143syn cluster shSubShList	contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq,shOperator
144syn cluster shTestList	contains=shCharClass,shCommandSub,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shSingleQuote,shTest,shTestOpr
145
146" Echo: {{{1
147" ====
148" This one is needed INSIDE a CommandSub, so that `echo bla` be correct
149syn 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
150syn 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
151syn match  shEchoQuote contained	'\%(\\\\\)*\\["`'()]'
152
153" This must be after the strings, so that ... \" will be correct
154syn 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
155
156" Alias: {{{1
157" =====
158if exists("b:is_kornshell") || exists("b:is_bash")
159 syn match shStatement "\<alias\>"
160 syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\h[-._[:alnum:]]\+\)\@="  skip="\\$" end="\>\|`"
161 syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\h[-._[:alnum:]]\+=\)\@=" skip="\\$" end="="
162
163 " Touch: {{{1
164 " =====
165 syn match shTouch	'\<touch\>[^;#]*'	skipwhite nextgroup=shTouchList contains=shTouchCmd
166 syn match shTouchCmd	'\<touch\>'		contained
167endif
168
169" Error Codes: {{{1
170" ============
171if !exists("g:sh_no_error")
172 syn match   shDoError "\<done\>"
173 syn match   shIfError "\<fi\>"
174 syn match   shInError "\<in\>"
175 syn match   shCaseError ";;"
176 syn match   shEsacError "\<esac\>"
177 syn match   shCurlyError "}"
178 syn match   shParenError ")"
179 syn match   shOK	'\.\(done\|fi\|in\|esac\)'
180 if exists("b:is_kornshell")
181  syn match     shDTestError "]]"
182 endif
183 syn match     shTestError "]"
184endif
185
186" Options: {{{1
187" ====================
188syn match   shOption	"\s\zs[-+][-_a-zA-Z#@]\+"
189syn match   shOption	"\s\zs--[^ \t$`'"|);]\+"
190
191" File Redirection Highlighted As Operators: {{{1
192"===========================================
193syn match      shRedir	"\d\=>\(&[-0-9]\)\="
194syn match      shRedir	"\d\=>>-\="
195syn match      shRedir	"\d\=<\(&[-0-9]\)\="
196syn match      shRedir	"\d<<-\="
197
198" Operators: {{{1
199" ==========
200syn match   shOperator	"<<\|>>"		contained
201syn match   shOperator	"[!&;|]"		contained
202syn match   shOperator	"\[[[^:]\|\]]"		contained
203syn match   shOperator	"[-=/*+%]\=="		skipwhite nextgroup=shPattern
204syn match   shPattern	"\<\S\+\())\)\@="	contained contains=shExSingleQuote,shSingleQuote,shExDoubleQuote,shDoubleQuote,shDeref
205
206" Subshells: {{{1
207" ==========
208syn region shExpr  transparent matchgroup=shExprRegion  start="{" end="}"		contains=@shExprList2 nextgroup=shMoreSpecial
209syn region shSubSh transparent matchgroup=shSubShRegion start="[^(]\zs(" end=")"	contains=@shSubShList nextgroup=shMoreSpecial
210
211" Tests: {{{1
212"=======
213syn region shExpr	matchgroup=shRange start="\[" skip=+\\\\\|\\$\|\[+ end="\]" contains=@shTestList,shSpecial
214syn region shTest	transparent matchgroup=shStatement start="\<test\s" skip=+\\\\\|\\$+ matchgroup=NONE end="[;&|]"me=e-1 end="$" contains=@shExprList1
215syn region shNoQuote	start='\S'	skip='\%(\\\\\)*\\.'	end='\ze\s'	contained
216syn match  shTestOpr	contained	'[^-+/%]\zs=' skipwhite nextgroup=shTestDoubleQuote,shTestSingleQuote,shTestPattern
217syn match  shTestOpr	contained	"<=\|>=\|!=\|==\|=\~\|-.\>\|-\(nt\|ot\|ef\|eq\|ne\|lt\|le\|gt\|ge\)\>\|[!<>]"
218syn match  shTestPattern	contained	'\w\+'
219syn region shTestDoubleQuote	contained	start='\%(\%(\\\\\)*\\\)\@<!"' skip=+\\\\\|\\"+ end='"'
220syn match  shTestSingleQuote	contained	'\\.'
221syn match  shTestSingleQuote	contained	"'[^']*'"
222if exists("b:is_kornshell") || exists("b:is_bash")
223 syn region  shDblBrace matchgroup=Delimiter start="\[\["	skip=+\%(\\\\\)*\\$+ end="\]\]"	contains=@shTestList,shNoQuote,shComment
224 syn region  shDblParen matchgroup=Delimiter start="(("	skip=+\%(\\\\\)*\\$+ end="))"	contains=@shTestList,shComment
225endif
226
227" Character Class In Range: {{{1
228" =========================
229syn match   shCharClass	contained	"\[:\(backspace\|escape\|return\|xdigit\|alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|tab\):\]"
230
231" Loops: do, if, while, until {{{1
232" ======
233ShFoldIfDoFor syn region shDo	transparent	matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>"			contains=@shLoopList
234ShFoldIfDoFor syn region shIf	transparent	matchgroup=shConditional start="\<if\_s" matchgroup=shConditional skip=+-fi\>+ end="\<;\_s*then\>" end="\<fi\>"	contains=@shIfList
235ShFoldIfDoFor syn region shFor		matchgroup=shLoop start="\<for\ze\_s\s*\%(((\)\@!" end="\<in\>" end="\<do\>"me=e-2			contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn
236ShFoldIfDoFor syn region shForPP	matchgroup=shLoop start='\<for\>\_s*((' end='))' contains=shTestOpr
237
238if exists("b:is_kornshell") || exists("b:is_bash")
239 syn cluster shCaseList	add=shRepeat
240 syn cluster shFunctionList	add=shRepeat
241 syn region shRepeat   matchgroup=shLoop   start="\<while\_s" end="\<in\_s" end="\<do\>"me=e-2	contains=@shLoopList,shDblParen,shDblBrace
242 syn region shRepeat   matchgroup=shLoop   start="\<until\_s" end="\<in\_s" end="\<do\>"me=e-2	contains=@shLoopList,shDblParen,shDblBrace
243 syn region shCaseEsac matchgroup=shConditional start="\<select\s" matchgroup=shConditional end="\<in\>" end="\<do\>" contains=@shLoopList
244else
245 syn region shRepeat   matchgroup=shLoop   start="\<while\_s" end="\<do\>"me=e-2		contains=@shLoopList
246 syn region shRepeat   matchgroup=shLoop   start="\<until\_s" end="\<do\>"me=e-2		contains=@shLoopList
247endif
248syn region shCurlyIn   contained	matchgroup=Delimiter start="{" end="}" contains=@shCurlyList
249syn match  shComma     contained	","
250
251" Case: case...esac {{{1
252" ====
253syn match   shCaseBar	contained skipwhite "\(^\|[^\\]\)\(\\\\\)*\zs|"		nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote
254syn match   shCaseStart	contained skipwhite skipnl "("			nextgroup=shCase,shCaseBar
255ShFoldIfDoFor syn region  shCase	contained skipwhite skipnl matchgroup=shSnglCase start="\%(\\.\|[^#$()'" \t]\)\{-}\zs)"  end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment
256ShFoldIfDoFor syn region  shCaseEsac	matchgroup=shConditional start="\<case\>" end="\<esac\>"	contains=@shCaseEsacList
257
258syn keyword shCaseIn	contained skipwhite skipnl in			nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote
259if exists("b:is_bash")
260 syn region  shCaseExSingleQuote	matchgroup=shQuote start=+\$'+ skip=+\\\\\|\\.+ end=+'+	contains=shStringSpecial,shSpecial	skipwhite skipnl nextgroup=shCaseBar	contained
261elseif !exists("g:sh_no_error")
262 syn region  shCaseExSingleQuote	matchgroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+	contains=shStringSpecial	skipwhite skipnl nextgroup=shCaseBar	contained
263endif
264syn region  shCaseSingleQuote	matchgroup=shQuote start=+'+ end=+'+		contains=shStringSpecial		skipwhite skipnl nextgroup=shCaseBar	contained
265syn region  shCaseDoubleQuote	matchgroup=shQuote start=+"+ skip=+\\\\\|\\.+ end=+"+	contains=@shDblQuoteList,shStringSpecial	skipwhite skipnl nextgroup=shCaseBar	contained
266syn region  shCaseCommandSub	start=+`+ skip=+\\\\\|\\.+ end=+`+		contains=@shCommandSubList		skipwhite skipnl nextgroup=shCaseBar	contained
267if exists("b:is_bash")
268 syn region  shCaseRange	matchgroup=Delimiter start=+\[+ skip=+\\\\+ end=+\]+	contained	contains=shCharClass
269 syn match   shCharClass	'\[:\%(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|word\|or\|xdigit\):\]'			contained
270else
271 syn region  shCaseRange	matchgroup=Delimiter start=+\[+ skip=+\\\\+ end=+\]+	contained
272endif
273" Misc: {{{1
274"======
275syn match   shWrapLineOperator "\\$"
276syn region  shCommandSub   start="`" skip="\\\\\|\\." end="`"	contains=@shCommandSubList
277syn match   shEscape	contained	'\%(^\)\@!\%(\\\\\)*\\.'
278
279" $() and $(()): {{{1
280" $(..) is not supported by sh (Bourne shell).  However, apparently
281" some systems (HP?) have as their /bin/sh a (link to) Korn shell
282" (ie. Posix compliant shell).  /bin/ksh should work for those
283" systems too, however, so the following syntax will flag $(..) as
284" an Error under /bin/sh.  By consensus of vimdev'ers!
285if exists("b:is_kornshell") || exists("b:is_bash")
286 syn region shCommandSub matchgroup=shCmdSubRegion start="\$("  skip='\\\\\|\\.' end=")"  contains=@shCommandSubList
287 syn region shArithmetic matchgroup=shArithRegion  start="\$((" skip='\\\\\|\\.' end="))" contains=@shArithList
288 syn region shArithmetic matchgroup=shArithRegion  start="\$\[" skip='\\\\\|\\.' end="\]" contains=@shArithList
289 syn match  shSkipInitWS contained	"^\s\+"
290elseif !exists("g:sh_no_error")
291 syn region shCommandSub matchgroup=Error start="\$(" end=")" contains=@shCommandSubList
292endif
293syn region shCmdParenRegion matchgroup=shCmdSubRegion start="(\ze[^(]" skip='\\\\\|\\.' end=")" contains=@shCommandSubList
294
295if exists("b:is_bash")
296 syn cluster shCommandSubList add=bashSpecialVariables,bashStatement
297 syn cluster shCaseList add=bashAdminStatement,bashStatement
298 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
299 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
300 syn keyword bashAdminStatement daemon killall killproc nice reload restart start status stop
301 syn keyword bashStatement	command compgen
302endif
303
304if exists("b:is_kornshell")
305 syn cluster shCommandSubList add=kshSpecialVariables,kshStatement
306 syn cluster shCaseList add=kshStatement
307 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
308 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
309 syn keyword kshStatement command setgroups setsenv
310endif
311
312syn match   shSource	"^\.\s"
313syn match   shSource	"\s\.\s"
314"syn region  shColon	start="^\s*:" end="$" end="\s#"me=e-2 contains=@shColonList
315"syn region  shColon	start="^\s*\zs:" end="$" end="\s#"me=e-2
316syn match   shColon	'^\s*\zs:'
317
318" String And Character Constants: {{{1
319"================================
320syn match   shNumber	"\<\d\+\>#\="
321syn match   shNumber	"-\=\.\=\d\+\>#\="
322syn match   shCtrlSeq	"\\\d\d\d\|\\[abcfnrtv0]"		contained
323if exists("b:is_bash")
324 syn match   shSpecial	"\\\o\o\o\|\\x\x\x\|\\c[^"]\|\\[abefnrtv]"	contained
325endif
326if exists("b:is_bash")
327 syn region  shExSingleQuote	matchgroup=shQuote start=+\$'+ skip=+\\\\\|\\.+ end=+'+	contains=shStringSpecial,shSpecial
328 syn region  shExDoubleQuote	matchgroup=shQuote start=+\$"+ skip=+\\\\\|\\.\|\\"+ end=+"+	contains=@shDblQuoteList,shStringSpecial,shSpecial
329elseif !exists("g:sh_no_error")
330 syn region  shExSingleQuote	matchGroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+	contains=shStringSpecial
331 syn region  shExDoubleQuote	matchGroup=Error start=+\$"+ skip=+\\\\\|\\.+ end=+"+	contains=shStringSpecial
332endif
333syn region  shSingleQuote	matchgroup=shQuote start=+'+ end=+'+		contains=@Spell
334syn region  shDoubleQuote	matchgroup=shQuote start=+\%(\%(\\\\\)*\\\)\@<!"+ skip=+\\"+ end=+"+	contains=@shDblQuoteList,shStringSpecial,@Spell
335syn match   shStringSpecial	"[^[:print:] \t]"		contained
336syn match   shStringSpecial	"\%(\\\\\)*\\[\\"'`$()#]"
337syn match   shSpecial	"[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]"
338syn match   shSpecial	"^\%(\\\\\)*\\[\\"'`$()#]"
339syn match   shMoreSpecial	"\%(\\\\\)*\\[\\"'`$()#]"		nextgroup=shMoreSpecial contained
340
341" Comments: {{{1
342"==========
343syn cluster	shCommentGroup	contains=shTodo,@Spell
344syn keyword	shTodo	contained		COMBAK FIXME TODO XXX
345syn match	shComment		"^\s*\zs#.*$"	contains=@shCommentGroup
346syn match	shComment		"\s\zs#.*$"	contains=@shCommentGroup
347syn match	shComment	contained	"#.*$"	contains=@shCommentGroup
348syn match	shQuickComment	contained	"#.*$"
349
350" Here Documents: {{{1
351" =========================================
352if version < 600
353 syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\**END[a-zA-Z_0-9]*\**" 	matchgroup=shHereDoc01 end="^END[a-zA-Z_0-9]*$"	contains=@shDblQuoteList
354 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
355 syn region shHereDoc matchgroup=shHereDoc03 start="<<\s*\**EOF\**"		matchgroup=shHereDoc03 end="^EOF$"	contains=@shDblQuoteList
356 syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*\**EOF\**"		matchgroup=shHereDoc04 end="^\s*EOF$"	contains=@shDblQuoteList
357 syn region shHereDoc matchgroup=shHereDoc05 start="<<\s*\**\.\**"		matchgroup=shHereDoc05 end="^\.$"	contains=@shDblQuoteList
358 syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*\**\.\**"		matchgroup=shHereDoc06 end="^\s*\.$"	contains=@shDblQuoteList
359
360else
361 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\\\=\z([^ \t|]\+\)"		matchgroup=shHereDoc07 end="^\z1\s*$"	contains=@shDblQuoteList
362 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<\s*\"\z([^ \t|]\+\)\""		matchgroup=shHereDoc08 end="^\z1\s*$"
363 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<-\s*\z([^ \t|]\+\)"		matchgroup=shHereDoc09 end="^\s*\z1\s*$"	contains=@shDblQuoteList
364 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*'\z([^ \t|]\+\)'"		matchgroup=shHereDoc10 end="^\s*\z1\s*$"
365 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<\s*'\z([^ \t|]\+\)'"		matchgroup=shHereDoc11 end="^\z1\s*$"
366 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\"\z([^ \t|]\+\)\""		matchgroup=shHereDoc12 end="^\s*\z1\s*$"
367 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<\s*\\\_$\_s*\z([^ \t|]\+\)"		matchgroup=shHereDoc13 end="^\z1\s*$"           contains=@shDblQuoteList
368 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\s*\\\_$\_s*'\z([^ \t|]\+\)'"	matchgroup=shHereDoc14 end="^\z1\s*$"
369 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<\s*\\\_$\_s*\"\z([^ \t|]\+\)\""	matchgroup=shHereDoc15 end="^\z1\s*$"
370 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\_$\_s*\z([^ \t|]\+\)"	matchgroup=shHereDoc16 end="^\s*\z1\s*$"
371 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc17 start="<<-\s*\\\_$\_s*\\\z([^ \t|]\+\)"	matchgroup=shHereDoc17 end="^\s*\z1\s*$"
372 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc18 start="<<-\s*\\\_$\_s*'\z([^ \t|]\+\)'"	matchgroup=shHereDoc18 end="^\s*\z1\s*$"
373 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc19 start="<<-\s*\\\_$\_s*\"\z([^ \t|]\+\)\""	matchgroup=shHereDoc19 end="^\s*\z1\s*$"
374 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc20 start="<<\\\z([^ \t|]\+\)"		matchgroup=shHereDoc20 end="^\z1\s*$"
375 ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc21 start="<<-\s*\\\z([^ \t|]\+\)"		matchgroup=shHereDoc21 end="^\s*\z1\s*$"
376endif
377
378" Here Strings: {{{1
379" =============
380" available for: bash; ksh (really should be ksh93 only) but not if its a posix
381if exists("b:is_bash") || (exists("b:is_kornshell") && !exists("g:is_posix"))
382 syn match shRedir "<<<"	skipwhite	nextgroup=shCmdParenRegion
383endif
384
385" Identifiers: {{{1
386"=============
387syn match  shSetOption	"\s\zs[-+][a-zA-Z0-9]\+\>"	contained
388syn match  shVariable	"\<\([bwglsav]:\)\=[a-zA-Z0-9.!@_%+,]*\ze="	nextgroup=shVarAssign
389syn match  shVarAssign	"="		contained	nextgroup=shCmdParenRegion,shPattern,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shSingleQuote,shExSingleQuote
390syn region shAtExpr	contained	start="@(" end=")" contains=@shIdList
391if exists("b:is_bash")
392 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
393 syn region shSetList oneline matchgroup=shSet start="\<set\>\ze[^/]" end="\ze[;|)]\|$"			matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+="	contains=@shIdList
394elseif exists("b:is_kornshell")
395 syn region shSetList oneline matchgroup=shSet start="\<\(typeset\|export\|unset\)\>\ze[^/]" end="$"		matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]"	contains=@shIdList
396 syn region shSetList oneline matchgroup=shSet start="\<set\>\ze[^/]" end="$"				matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]"	contains=@shIdList
397else
398 syn region shSetList oneline matchgroup=shSet start="\<\(set\|export\|unset\)\>\ze[^/]" end="$"		matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]"	contains=@shIdList
399endif
400
401" Functions: {{{1
402if !exists("g:is_posix")
403 syn keyword shFunctionKey function	skipwhite skipnl nextgroup=shFunctionTwo
404endif
405
406if exists("b:is_bash")
407 ShFoldFunctions syn region shFunctionOne	matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*{"		end="}"	contains=@shFunctionList			skipwhite skipnl nextgroup=shFunctionStart,shQuickComment
408 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
409 ShFoldFunctions syn region shFunctionThree	matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*("		end=")"	contains=@shFunctionList			skipwhite skipnl nextgroup=shFunctionStart,shQuickComment
410 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
411else
412 ShFoldFunctions syn region shFunctionOne	matchgroup=shFunction start="^\s*\h\w*\s*()\_s*{"		end="}"	contains=@shFunctionList	       skipwhite skipnl		nextgroup=shFunctionStart,shQuickComment
413 ShFoldFunctions syn region shFunctionTwo	matchgroup=shFunction start="\<[^d][^o]\&\h\w*\s*\%(()\)\=\_s*{"	end="}"	contains=shFunctionKey,@shFunctionList contained skipwhite skipnl	nextgroup=shFunctionStart,shQuickComment
414 ShFoldFunctions syn region shFunctionThree	matchgroup=shFunction start="^\s*\h\w*\s*()\_s*("		end=")"	contains=@shFunctionList	       skipwhite skipnl		nextgroup=shFunctionStart,shQuickComment
415 ShFoldFunctions syn region shFunctionFour	matchgroup=shFunction start="\<[^d][^o]\&\h\w*\s*\%(()\)\=\_s*("	end=")"	contains=shFunctionKey,@shFunctionList contained skipwhite skipnl	nextgroup=shFunctionStart,shQuickComment
416endif
417
418" Parameter Dereferencing: {{{1
419" ========================
420if !exists("g:sh_no_error")
421 syn match  shDerefWordError	"[^}$[]"	contained
422endif
423syn match  shDerefSimple	"\$\%(\k\+\|\d\)"
424syn region shDeref	matchgroup=PreProc start="\${" end="}"	contains=@shDerefList,shDerefVarArray
425syn match  shDerefSimple	"\$[-#*@!?]"
426syn match  shDerefSimple	"\$\$"
427if exists("b:is_bash") || exists("b:is_kornshell")
428 syn region shDeref	matchgroup=PreProc start="\${##\=" end="}"	contains=@shDerefList
429 syn region shDeref	matchgroup=PreProc start="\${\$\$" end="}"	contains=@shDerefList
430endif
431
432" ksh: ${!var[*]} array index list syntax: {{{1
433" ========================================
434if exists("b:is_kornshell")
435 syn region shDeref	matchgroup=PreProc start="\${!" end="}"	contains=@shDerefVarArray
436endif
437
438" bash: ${!prefix*} and ${#parameter}: {{{1
439" ====================================
440if exists("b:is_bash")
441 syn region shDeref	matchgroup=PreProc start="\${!" end="\*\=}"	contains=@shDerefList,shDerefOp
442 syn match  shDerefVar	contained	"{\@<=!\k\+"		nextgroup=@shDerefVarList
443endif
444if exists("b:is_kornshell")
445 syn match  shDerefVar	contained	"{\@<=!\k[[:alnum:]_.]*"	nextgroup=@shDerefVarList
446endif
447
448syn match  shDerefSpecial	contained	"{\@<=[-*@?0]"		nextgroup=shDerefOp,shDerefOpError
449syn match  shDerefSpecial	contained	"\({[#!]\)\@<=[[:alnum:]*@_]\+"	nextgroup=@shDerefVarList,shDerefOp
450syn match  shDerefVar	contained	"{\@<=\k\+"		nextgroup=@shDerefVarList
451if exists("b:is_kornshell")
452  syn match  shDerefVar	contained	"{\@<=\k[[:alnum:]_.]*"	nextgroup=@shDerefVarList
453endif
454
455" sh ksh bash : ${var[... ]...}  array reference: {{{1
456syn region  shDerefVarArray   contained	matchgroup=shDeref start="\[" end="]"	contains=@shCommandSubList nextgroup=shDerefOp,shDerefOpError
457
458" Special ${parameter OPERATOR word} handling: {{{1
459" sh ksh bash : ${parameter:-word}    word is default value
460" sh ksh bash : ${parameter:=word}    assign word as default value
461" sh ksh bash : ${parameter:?word}    display word if parameter is null
462" sh ksh bash : ${parameter:+word}    use word if parameter is not null, otherwise nothing
463"    ksh bash : ${parameter#pattern}  remove small left  pattern
464"    ksh bash : ${parameter##pattern} remove large left  pattern
465"    ksh bash : ${parameter%pattern}  remove small right pattern
466"    ksh bash : ${parameter%%pattern} remove large right pattern
467"        bash : ${parameter^pattern}  Case modification
468"        bash : ${parameter^^pattern} Case modification
469"        bash : ${parameter,pattern}  Case modification
470"        bash : ${parameter,,pattern} Case modification
471syn cluster shDerefPatternList	contains=shDerefPattern,shDerefString
472if !exists("g:sh_no_error")
473 syn match shDerefOpError	contained	":[[:punct:]]"
474endif
475syn match  shDerefOp	contained	":\=[-=?]"	nextgroup=@shDerefPatternList
476syn match  shDerefOp	contained	":\=+"	nextgroup=@shDerefPatternList
477if exists("b:is_bash") || exists("b:is_kornshell")
478 syn match  shDerefOp	contained	"#\{1,2}"	nextgroup=@shDerefPatternList
479 syn match  shDerefOp	contained	"%\{1,2}"	nextgroup=@shDerefPatternList
480 syn match  shDerefPattern	contained	"[^{}]\+"	contains=shDeref,shDerefSimple,shDerefPattern,shDerefString,shCommandSub,shDerefEscape nextgroup=shDerefPattern
481 syn region shDerefPattern	contained	start="{" end="}"	contains=shDeref,shDerefSimple,shDerefString,shCommandSub nextgroup=shDerefPattern
482 syn match  shDerefEscape	contained	'\%(\\\\\)*\\.'
483endif
484if exists("b:is_bash")
485 syn match  shDerefOp	contained	"[,^]\{1,2}"	nextgroup=@shDerefPatternList
486endif
487syn region shDerefString	contained	matchgroup=shDerefDelim start=+\%(\\\)\@<!'+ end=+'+		contains=shStringSpecial
488syn region shDerefString	contained	matchgroup=shDerefDelim start=+\%(\\\)\@<!"+ skip=+\\"+ end=+"+	contains=@shDblQuoteList,shStringSpecial
489syn match  shDerefString	contained	"\\["']"	nextgroup=shDerefPattern
490
491if exists("b:is_bash")
492 " bash : ${parameter:offset}
493 " bash : ${parameter:offset:length}
494 syn region shDerefOp	contained	start=":[$[:alnum:]_]"me=e-1 end=":"me=e-1 end="}"me=e-1 contains=@shCommandSubList nextgroup=shDerefPOL
495 syn match  shDerefPOL	contained	":[^}]\+"	contains=@shCommandSubList
496
497 " bash : ${parameter//pattern/string}
498 " bash : ${parameter//pattern}
499 syn match  shDerefPPS	contained	'/\{1,2}'	nextgroup=shDerefPPSleft
500 syn region shDerefPPSleft	contained	start='.'	skip=@\%(\\\\\)*\\/@ matchgroup=shDerefOp	end='/' end='\ze}' nextgroup=shDerefPPSright contains=@shCommandSubList
501 syn region shDerefPPSright	contained	start='.'	skip=@\%(\\\\\)\+@		end='\ze}'	contains=@shCommandSubList
502
503 " bash : ${parameter/#substring/replacement}
504 syn match  shDerefPSR	contained	'/#'	nextgroup=shDerefPSRleft
505 syn region shDerefPSRleft	contained	start='.'	skip=@\%(\\\\\)*\\/@ matchgroup=shDerefOp	end='/' end='\ze}' nextgroup=shDerefPSRright
506 syn region shDerefPSRright	contained	start='.'	skip=@\%(\\\\\)\+@		end='\ze}'
507endif
508
509" Arithmetic Parenthesized Expressions: {{{1
510"syn region shParen matchgroup=shArithRegion start='[^$]\zs(\%(\ze[^(]\|$\)' end=')' contains=@shArithParenList
511syn region shParen matchgroup=shArithRegion start='\$\@!(\%(\ze[^(]\|$\)' end=')' contains=@shArithParenList
512
513" Useful sh Keywords: {{{1
514" ===================
515syn keyword shStatement break cd chdir continue eval exec exit kill newgrp pwd read readonly return shift test trap ulimit umask wait
516syn keyword shConditional contained elif else then
517if !exists("g:sh_no_error")
518 syn keyword shCondError elif else then
519endif
520
521" Useful ksh Keywords: {{{1
522" ====================
523if exists("b:is_kornshell") || exists("b:is_bash")
524 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
525 if exists("g:is_posix")
526  syn keyword shStatement command
527 else
528  syn keyword shStatement time
529 endif
530
531" Useful bash Keywords: {{{1
532" =====================
533 if exists("b:is_bash")
534  syn keyword shStatement bind builtin dirs disown enable help local logout popd pushd shopt source
535 else
536  syn keyword shStatement login newgrp
537 endif
538endif
539
540" Synchronization: {{{1
541" ================
542if !exists("g:sh_minlines")
543 let s:sh_minlines = 200
544else
545 let s:sh_minlines= g:sh_minlines
546endif
547if !exists("g:sh_maxlines")
548 let s:sh_maxlines = 2*s:sh_minlines
549 if s:sh_maxlines < 25
550  let s:sh_maxlines= 25
551 endif
552else
553 let s:sh_maxlines= g:sh_maxlines
554endif
555exec "syn sync minlines=" . s:sh_minlines . " maxlines=" . s:sh_maxlines
556syn sync match shCaseEsacSync	grouphere	shCaseEsac	"\<case\>"
557syn sync match shCaseEsacSync	groupthere	shCaseEsac	"\<esac\>"
558syn sync match shDoSync	grouphere	shDo	"\<do\>"
559syn sync match shDoSync	groupthere	shDo	"\<done\>"
560syn sync match shForSync	grouphere	shFor	"\<for\>"
561syn sync match shForSync	groupthere	shFor	"\<in\>"
562syn sync match shIfSync	grouphere	shIf	"\<if\>"
563syn sync match shIfSync	groupthere	shIf	"\<fi\>"
564syn sync match shUntilSync	grouphere	shRepeat	"\<until\>"
565syn sync match shWhileSync	grouphere	shRepeat	"\<while\>"
566
567" Default Highlighting: {{{1
568" =====================
569hi def link shArithRegion	shShellVariables
570hi def link shAtExpr	shSetList
571hi def link shBeginHere	shRedir
572hi def link shCaseBar	shConditional
573hi def link shCaseCommandSub	shCommandSub
574hi def link shCaseDoubleQuote	shDoubleQuote
575hi def link shCaseIn	shConditional
576hi def link shQuote	shOperator
577hi def link shCaseSingleQuote	shSingleQuote
578hi def link shCaseStart	shConditional
579hi def link shCmdSubRegion	shShellVariables
580hi def link shColon	shComment
581hi def link shDerefOp	shOperator
582hi def link shDerefPOL	shDerefOp
583hi def link shDerefPPS	shDerefOp
584hi def link shDerefPSR	shDerefOp
585hi def link shDeref	shShellVariables
586hi def link shDerefDelim	shOperator
587hi def link shDerefSimple	shDeref
588hi def link shDerefSpecial	shDeref
589hi def link shDerefString	shDoubleQuote
590hi def link shDerefVar	shDeref
591hi def link shDoubleQuote	shString
592hi def link shEcho	shString
593hi def link shEchoDelim	shOperator
594hi def link shEchoQuote	shString
595hi def link shForPP	shLoop
596hi def link shEmbeddedEcho	shString
597hi def link shEscape	shCommandSub
598hi def link shExDoubleQuote	shDoubleQuote
599hi def link shExSingleQuote	shSingleQuote
600hi def link shFunction	Function
601hi def link shHereDoc	shString
602hi def link shHerePayload	shHereDoc
603hi def link shLoop	shStatement
604hi def link shMoreSpecial	shSpecial
605hi def link shNoQuote	shDoubleQuote
606hi def link shOption	shCommandSub
607hi def link shPattern	shString
608hi def link shParen	shArithmetic
609hi def link shPosnParm	shShellVariables
610hi def link shQuickComment	shComment
611hi def link shRange	shOperator
612hi def link shRedir	shOperator
613hi def link shSetListDelim	shOperator
614hi def link shSetOption	shOption
615hi def link shSingleQuote	shString
616hi def link shSource	shOperator
617hi def link shStringSpecial	shSpecial
618hi def link shSubShRegion	shOperator
619hi def link shTestOpr	shConditional
620hi def link shTestPattern	shString
621hi def link shTestDoubleQuote	shString
622hi def link shTestSingleQuote	shString
623hi def link shTouchCmd	shStatement
624hi def link shVariable	shSetList
625hi def link shWrapLineOperator	shOperator
626
627if exists("b:is_bash")
628  hi def link bashAdminStatement	shStatement
629  hi def link bashSpecialVariables	shShellVariables
630  hi def link bashStatement		shStatement
631  hi def link shFunctionParen		Delimiter
632  hi def link shFunctionDelim		Delimiter
633  hi def link shCharClass		shSpecial
634endif
635if exists("b:is_kornshell")
636  hi def link kshSpecialVariables	shShellVariables
637  hi def link kshStatement		shStatement
638  hi def link shFunctionParen		Delimiter
639endif
640
641if !exists("g:sh_no_error")
642 hi def link shCaseError		Error
643 hi def link shCondError		Error
644 hi def link shCurlyError		Error
645 hi def link shDerefError		Error
646 hi def link shDerefOpError		Error
647 hi def link shDerefWordError		Error
648 hi def link shDoError		Error
649 hi def link shEsacError		Error
650 hi def link shIfError		Error
651 hi def link shInError		Error
652 hi def link shParenError		Error
653 hi def link shTestError		Error
654 if exists("b:is_kornshell")
655   hi def link shDTestError		Error
656 endif
657endif
658
659hi def link shArithmetic		Special
660hi def link shCharClass		Identifier
661hi def link shSnglCase		Statement
662hi def link shCommandSub		Special
663hi def link shComment		Comment
664hi def link shConditional		Conditional
665hi def link shCtrlSeq		Special
666hi def link shExprRegion		Delimiter
667hi def link shFunctionKey		Function
668hi def link shFunctionName		Function
669hi def link shNumber		Number
670hi def link shOperator		Operator
671hi def link shRepeat		Repeat
672hi def link shSet		Statement
673hi def link shSetList		Identifier
674hi def link shShellVariables		PreProc
675hi def link shSpecial		Special
676hi def link shStatement		Statement
677hi def link shString		String
678hi def link shTodo		Todo
679hi def link shAlias		Identifier
680hi def link shHereDoc01		shRedir
681hi def link shHereDoc02		shRedir
682hi def link shHereDoc03		shRedir
683hi def link shHereDoc04		shRedir
684hi def link shHereDoc05		shRedir
685hi def link shHereDoc06		shRedir
686hi def link shHereDoc07		shRedir
687hi def link shHereDoc08		shRedir
688hi def link shHereDoc09		shRedir
689hi def link shHereDoc10		shRedir
690hi def link shHereDoc11		shRedir
691hi def link shHereDoc12		shRedir
692hi def link shHereDoc13		shRedir
693hi def link shHereDoc14		shRedir
694hi def link shHereDoc15		shRedir
695hi def link shHereDoc16		shRedir
696hi def link shHereDoc17		shRedir
697hi def link shHereDoc18		shRedir
698hi def link shHereDoc19		shRedir
699hi def link shHereDoc20		shRedir
700hi def link shHereDoc21		shRedir
701
702" Delete shell folding commands {{{1
703" =============================
704delc ShFoldFunctions
705delc ShFoldHereDoc
706delc ShFoldIfDoFor
707
708" Set Current Syntax: {{{1
709" ===================
710if exists("b:is_bash")
711 let b:current_syntax = "bash"
712elseif exists("b:is_kornshell")
713 let b:current_syntax = "ksh"
714else
715 let b:current_syntax = "sh"
716endif
717
718" vim: ts=16 fdm=marker
719