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