Mercurial > vim
annotate runtime/syntax/sh.vim @ 2565:4b7929dad28a vim73
Fix building the Mac version with GUI.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 14 Aug 2010 21:56:42 +0200 |
parents | e8a81e381ad2 |
children | b0d34143ebfc |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: shell (sh) Korn shell (ksh) bash (sh) | |
3 " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz> | |
4 " Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int> | |
2497 | 5 " Last Change: Aug 04, 2010 |
6 " Version: 114 | |
507 | 7 " URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax |
1668 | 8 " For options and settings, please use: :help ft-sh-syntax |
2473
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
9 " This file includes many ideas from ?ric Brunet (eric.brunet@ens.fr) |
7 | 10 |
22 | 11 " For version 5.x: Clear all syntax items {{{1 |
7 | 12 " For version 6.x: Quit when a syntax file was already loaded |
13 if version < 600 | |
14 syntax clear | |
15 elseif exists("b:current_syntax") | |
16 finish | |
17 endif | |
18 | |
22 | 19 " handling /bin/sh with is_kornshell/is_sh {{{1 |
7 | 20 " b:is_sh is set when "#! /bin/sh" is found; |
21 " However, it often is just a masquerade by bash (typically Linux) | |
22 " or kornshell (typically workstations with Posix "sh"). | |
23 " So, when the user sets "is_bash" or "is_kornshell", | |
24 " a b:is_sh is converted into b:is_bash/b:is_kornshell, | |
25 " respectively. | |
26 if !exists("b:is_kornshell") && !exists("b:is_bash") | |
828 | 27 if exists("g:is_posix") && !exists("g:is_kornshell") |
28 let g:is_kornshell= g:is_posix | |
29 endif | |
30 if exists("g:is_kornshell") | |
7 | 31 let b:is_kornshell= 1 |
32 if exists("b:is_sh") | |
33 unlet b:is_sh | |
34 endif | |
828 | 35 elseif exists("g:is_bash") |
7 | 36 let b:is_bash= 1 |
37 if exists("b:is_sh") | |
38 unlet b:is_sh | |
39 endif | |
40 else | |
41 let b:is_sh= 1 | |
42 endif | |
43 endif | |
44 | |
199 | 45 " set up default g:sh_fold_enabled {{{1 |
7 | 46 if !exists("g:sh_fold_enabled") |
47 let g:sh_fold_enabled= 0 | |
36 | 48 elseif g:sh_fold_enabled != 0 && !has("folding") |
49 let g:sh_fold_enabled= 0 | |
199 | 50 echomsg "Ignoring g:sh_fold_enabled=".g:sh_fold_enabled."; need to re-compile vim for +fold support" |
51 endif | |
1668 | 52 if !exists("s:sh_fold_functions") |
53 let s:sh_fold_functions = 1 | |
54 endif | |
55 if !exists("s:sh_fold_heredoc") | |
56 let s:sh_fold_heredoc = 2 | |
57 endif | |
58 if !exists("s:sh_fold_ifdofor") | |
59 let s:sh_fold_ifdofor = 4 | |
60 endif | |
199 | 61 if g:sh_fold_enabled && &fdm == "manual" |
2152 | 62 setlocal fdm=syntax |
7 | 63 endif |
64 | |
199 | 65 " sh syntax is case sensitive {{{1 |
7 | 66 syn case match |
67 | |
22 | 68 " Clusters: contains=@... clusters {{{1 |
7 | 69 "================================== |
2034 | 70 syn cluster shErrorList contains=shDoError,shIfError,shInError,shCaseError,shEsacError,shCurlyError,shParenError,shTestError,shOK |
1668 | 71 if exists("b:is_kornshell") |
72 syn cluster ErrorList add=shDTestError | |
73 endif | |
2497 | 74 syn 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 |
1668 | 75 syn cluster shArithList contains=@shArithParenList,shParenError |
2034 | 76 syn cluster shCaseEsacList contains=shCaseStart,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote,shCtrlSeq,@shErrorList,shStringSpecial,shCaseRange |
1121 | 77 syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq |
7 | 78 syn cluster shColonList contains=@shCaseList |
2497 | 79 syn cluster shCommandSubList contains=shArithmetic,shDeref,shDerefSimple,shEscape,shNumber,shOperator,shPosnParm,shExSingleQuote,shSingleQuote,shExDoubleQuote,shDoubleQuote,shStatement,shVariable,shSubSh,shAlias,shTest,shCtrlSeq,shSpecial |
464 | 80 syn cluster shCurlyList contains=shNumber,shComma,shDeref,shDerefSimple,shDerefSpecial |
2497 | 81 syn cluster shDblQuoteList contains=shCommandSub,shDeref,shDerefSimple,shPosnParm,shCtrlSeq,shSpecial |
482 | 82 syn cluster shDerefList contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError,shDerefPPS |
7 | 83 syn cluster shDerefVarList contains=shDerefOp,shDerefVarArray,shDerefOpError |
2497 | 84 syn cluster shEchoList contains=shArithmetic,shCommandSub,shDeref,shDerefSimple,shExpr,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shCtrlSeq,shEchoQuote |
85 syn cluster shExprList1 contains=shCharClass,shNumber,shOperator,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shDblBrace,shDeref,shDerefSimple,shCtrlSeq | |
119 | 86 syn cluster shExprList2 contains=@shExprList1,@shCaseList,shTest |
2034 | 87 syn cluster shFunctionList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shOption,shRedir,shSetList,shSource,shStatement,shVariable,shOperator,shCtrlSeq |
1201 | 88 if exists("b:is_kornshell") || exists("b:is_bash") |
1668 | 89 syn cluster shFunctionList add=shRepeat |
1201 | 90 syn cluster shFunctionList add=shDblBrace,shDblParen |
91 endif | |
7 | 92 syn cluster shHereBeginList contains=@shCommandSubList |
93 syn cluster shHereList contains=shBeginHere,shHerePayload | |
94 syn cluster shHereListDQ contains=shBeginHere,@shDblQuoteList,shHerePayload | |
2497 | 95 syn cluster shIdList contains=shCommandSub,shWrapLineOperator,shSetOption,shDeref,shDerefSimple,shRedir,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shCtrlSeq,shStringSpecial |
1668 | 96 syn cluster shLoopList contains=@shCaseList,shTestOpr,shExpr,shDblBrace,shConditional,shCaseEsac,shTest,@shErrorList,shSet |
2034 | 97 syn cluster shSubShList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq,shOperator |
2497 | 98 syn cluster shTestList contains=shCharClass,shComment,shCommandSub,shDeref,shDerefSimple,shExDoubleQuote,shDoubleQuote,shExpr,shExpr,shNumber,shOperator,shExSingleQuote,shSingleQuote,shTestOpr,shTest,shCtrlSeq |
7 | 99 |
22 | 100 " Echo: {{{1 |
7 | 101 " ==== |
102 " This one is needed INSIDE a CommandSub, so that `echo bla` be correct | |
2473
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
103 syn 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 |
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
104 syn 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 |
2034 | 105 syn match shEchoQuote contained '\%(\\\\\)*\\["`'()]' |
7 | 106 |
1668 | 107 " This must be after the strings, so that ... \" will be correct |
2497 | 108 syn 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 |
7 | 109 |
22 | 110 " Alias: {{{1 |
7 | 111 " ===== |
112 if exists("b:is_kornshell") || exists("b:is_bash") | |
113 syn match shStatement "\<alias\>" | |
114 syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\w\+\)\@=" skip="\\$" end="\>\|`" | |
115 syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\w\+=\)\@=" skip="\\$" end="=" | |
116 endif | |
117 | |
22 | 118 " Error Codes: {{{1 |
119 " ============ | |
7 | 120 syn match shDoError "\<done\>" |
121 syn match shIfError "\<fi\>" | |
122 syn match shInError "\<in\>" | |
123 syn match shCaseError ";;" | |
124 syn match shEsacError "\<esac\>" | |
125 syn match shCurlyError "}" | |
126 syn match shParenError ")" | |
2034 | 127 syn match shOK '\.\(done\|fi\|in\|esac\)' |
7 | 128 if exists("b:is_kornshell") |
129 syn match shDTestError "]]" | |
130 endif | |
131 syn match shTestError "]" | |
132 | |
1668 | 133 " Options: {{{1 |
22 | 134 " ==================== |
2357
d706822076b1
Updated sh and vim syntax files. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2152
diff
changeset
|
135 syn match shOption "\s\zs[-+][-_a-zA-Z0-9]\+\>" |
1668 | 136 syn match shOption "\s\zs--[^ \t$`'"|]\+" |
7 | 137 |
1201 | 138 " File Redirection Highlighted As Operators: {{{1 |
139 "=========================================== | |
140 syn match shRedir "\d\=>\(&[-0-9]\)\=" | |
141 syn match shRedir "\d\=>>-\=" | |
142 syn match shRedir "\d\=<\(&[-0-9]\)\=" | |
143 syn match shRedir "\d<<-\=" | |
144 | |
22 | 145 " Operators: {{{1 |
146 " ========== | |
1201 | 147 syn match shOperator "<<\|>>" contained |
1668 | 148 syn match shOperator "[!&;|]" contained |
149 syn match shOperator "\[[[^:]\|\]]" contained | |
7 | 150 syn match shOperator "!\==" skipwhite nextgroup=shPattern |
2497 | 151 syn match shPattern "\<\S\+\())\)\@=" contained contains=shExSingleQuote,shSingleQuote,shExDoubleQuote,shDoubleQuote,shDeref |
7 | 152 |
22 | 153 " Subshells: {{{1 |
154 " ========== | |
2034 | 155 syn region shExpr transparent matchgroup=shExprRegion start="{" end="}" contains=@shExprList2 nextgroup=shMoreSpecial |
156 syn region shSubSh transparent matchgroup=shSubShRegion start="(" end=")" contains=@shSubShList nextgroup=shMoreSpecial | |
7 | 157 |
22 | 158 " Tests: {{{1 |
159 "======= | |
2152 | 160 syn region shExpr matchgroup=shRange start="\[" skip=+\\\\\|\\$\|\[+ end="\]" contains=@shTestList,shSpecial |
2034 | 161 syn region shTest transparent matchgroup=shStatement start="\<test\s" skip=+\\\\\|\\$+ matchgroup=NONE end="[;&|]"me=e-1 end="$" contains=@shExprList1 |
1121 | 162 syn match shTestOpr contained "<=\|>=\|!=\|==\|-.\>\|-\(nt\|ot\|ef\|eq\|ne\|lt\|le\|gt\|ge\)\>\|[!<>]" |
163 syn match shTestOpr contained '=' skipwhite nextgroup=shTestDoubleQuote,shTestSingleQuote,shTestPattern | |
164 syn match shTestPattern contained '\w\+' | |
165 syn match shTestDoubleQuote contained '"[^"]*"' | |
166 syn match shTestSingleQuote contained '\\.' | |
167 syn match shTestSingleQuote contained "'[^']*'" | |
7 | 168 if exists("b:is_kornshell") || exists("b:is_bash") |
169 syn region shDblBrace matchgroup=Delimiter start="\[\[" skip=+\\\\\|\\$+ end="\]\]" contains=@shTestList | |
170 syn region shDblParen matchgroup=Delimiter start="((" skip=+\\\\\|\\$+ end="))" contains=@shTestList | |
171 endif | |
172 | |
22 | 173 " Character Class In Range: {{{1 |
174 " ========================= | |
7 | 175 syn match shCharClass contained "\[:\(backspace\|escape\|return\|xdigit\|alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|tab\):\]" |
176 | |
22 | 177 " Loops: do, if, while, until {{{1 |
178 " ====== | |
1668 | 179 if (g:sh_fold_enabled % (s:sh_fold_ifdofor * 2))/s:sh_fold_ifdofor |
820 | 180 syn region shDo fold transparent matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>" contains=@shLoopList |
1668 | 181 syn region shIf fold transparent matchgroup=shConditional start="\<if\_s" matchgroup=shConditional end="\<;\_s*then\>" end="\<fi\>" contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey |
182 syn region shFor fold matchgroup=shLoop start="\<for\_s" end="\<in\_s" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn | |
820 | 183 else |
184 syn region shDo transparent matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>" contains=@shLoopList | |
1668 | 185 syn region shIf transparent matchgroup=shConditional start="\<if\_s" matchgroup=shConditional end="\<;\_s*then\>" end="\<fi\>" contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey |
186 syn region shFor matchgroup=shLoop start="\<for\_s" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn | |
820 | 187 endif |
7 | 188 if exists("b:is_kornshell") || exists("b:is_bash") |
1668 | 189 syn cluster shCaseList add=shRepeat |
190 syn cluster shFunctionList add=shRepeat | |
191 syn region shRepeat matchgroup=shLoop start="\<while\_s" end="\<in\_s" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen,shDblBrace | |
192 syn region shRepeat matchgroup=shLoop start="\<until\_s" end="\<in\_s" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen,shDblBrace | |
193 syn region shCaseEsac matchgroup=shConditional start="\<select\s" matchgroup=shConditional end="\<in\>" end="\<do\>" contains=@shLoopList | |
7 | 194 else |
1668 | 195 syn region shRepeat matchgroup=shLoop start="\<while\_s" end="\<do\>"me=e-2 contains=@shLoopList |
196 syn region shRepeat matchgroup=shLoop start="\<until\_s" end="\<do\>"me=e-2 contains=@shLoopList | |
7 | 197 endif |
464 | 198 syn region shCurlyIn contained matchgroup=Delimiter start="{" end="}" contains=@shCurlyList |
199 syn match shComma contained "," | |
7 | 200 |
22 | 201 " Case: case...esac {{{1 |
7 | 202 " ==== |
1668 | 203 syn match shCaseBar contained skipwhite "\(^\|[^\\]\)\(\\\\\)*\zs|" nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote |
7 | 204 syn match shCaseStart contained skipwhite skipnl "(" nextgroup=shCase,shCaseBar |
1668 | 205 if (g:sh_fold_enabled % (s:sh_fold_ifdofor * 2))/s:sh_fold_ifdofor |
2034 | 206 syn region shCase fold contained skipwhite skipnl matchgroup=shSnglCase start="\%(\\.\|[^#$()'" \t]\)\{-}\zs)" end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment |
820 | 207 syn region shCaseEsac fold matchgroup=shConditional start="\<case\>" end="\<esac\>" contains=@shCaseEsacList |
208 else | |
2034 | 209 syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="\%(\\.\|[^#$()'" \t]\)\{-}\zs)" end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment |
820 | 210 syn region shCaseEsac matchgroup=shConditional start="\<case\>" end="\<esac\>" contains=@shCaseEsacList |
211 endif | |
167 | 212 syn keyword shCaseIn contained skipwhite skipnl in nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote |
213 if exists("b:is_bash") | |
2473
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
214 syn region shCaseExSingleQuote matchgroup=shQuote start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial skipwhite skipnl nextgroup=shCaseBar contained |
167 | 215 else |
216 syn region shCaseExSingleQuote matchgroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained | |
217 endif | |
2473
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
218 syn region shCaseSingleQuote matchgroup=shQuote start=+'+ end=+'+ contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained |
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
219 syn region shCaseDoubleQuote matchgroup=shQuote start=+"+ skip=+\\\\\|\\.+ end=+"+ contains=@shDblQuoteList,shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained |
7 | 220 syn region shCaseCommandSub start=+`+ skip=+\\\\\|\\.+ end=+`+ contains=@shCommandSubList skipwhite skipnl nextgroup=shCaseBar contained |
2034 | 221 syn region shCaseRange matchgroup=Delimiter start=+\[+ skip=+\\\\+ end=+]+ contained |
7 | 222 |
22 | 223 " Misc: {{{1 |
224 "====== | |
7 | 225 syn match shWrapLineOperator "\\$" |
226 syn region shCommandSub start="`" skip="\\\\\|\\." end="`" contains=@shCommandSubList | |
1668 | 227 syn match shEscape contained '\\.' |
7 | 228 |
22 | 229 " $() and $(()): {{{1 |
7 | 230 " $(..) is not supported by sh (Bourne shell). However, apparently |
231 " some systems (HP?) have as their /bin/sh a (link to) Korn shell | |
232 " (ie. Posix compliant shell). /bin/ksh should work for those | |
233 " systems too, however, so the following syntax will flag $(..) as | |
234 " an Error under /bin/sh. By consensus of vimdev'ers! | |
235 if exists("b:is_kornshell") || exists("b:is_bash") | |
236 syn region shCommandSub matchgroup=shCmdSubRegion start="\$(" skip='\\\\\|\\.' end=")" contains=@shCommandSubList | |
1668 | 237 syn region shArithmetic matchgroup=shArithRegion start="\$((" skip='\\\\\|\\.' end="))" contains=@shArithList |
7 | 238 syn match shSkipInitWS contained "^\s\+" |
239 else | |
167 | 240 syn region shCommandSub matchgroup=Error start="\$(" end=")" contains=@shCommandSubList |
7 | 241 endif |
242 | |
243 if exists("b:is_bash") | |
244 syn cluster shCommandSubList add=bashSpecialVariables,bashStatement | |
245 syn cluster shCaseList add=bashAdminStatement,bashStatement | |
246 syn keyword bashSpecialVariables contained BASH BASH_ENV BASH_VERSINFO BASH_VERSION CDPATH DIRSTACK EUID FCEDIT FIGNORE GLOBIGNORE GROUPS HISTCMD HISTCONTROL HISTFILE HISTFILESIZE HISTIGNORE HISTSIZE HOME HOSTFILE HOSTNAME HOSTTYPE IFS IGNOREEOF INPUTRC LANG LC_ALL LC_COLLATE LC_MESSAGES LINENO MACHTYPE MAIL MAILCHECK MAILPATH OLDPWD OPTARG OPTERR OPTIND OSTYPE PATH PIPESTATUS PPID PROMPT_COMMAND PS1 PS2 PS3 PS4 PWD RANDOM REPLY SECONDS SHELLOPTS SHLVL TIMEFORMAT TIMEOUT UID auto_resume histchars | |
247 syn keyword bashStatement chmod clear complete du egrep expr fgrep find gnufind gnugrep grep install less ls mkdir mv rm rmdir rpm sed sleep sort strip tail touch | |
248 syn keyword bashAdminStatement daemon killall killproc nice reload restart start status stop | |
249 endif | |
250 | |
251 if exists("b:is_kornshell") | |
252 syn cluster shCommandSubList add=kshSpecialVariables,kshStatement | |
253 syn cluster shCaseList add=kshStatement | |
254 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 | |
255 syn keyword kshStatement cat chmod clear cp du egrep expr fgrep find grep install killall less ls mkdir mv nice printenv rm rmdir sed sort strip stty tail touch tput | |
256 endif | |
257 | |
258 syn match shSource "^\.\s" | |
259 syn match shSource "\s\.\s" | |
2034 | 260 "syn region shColon start="^\s*:" end="$" end="\s#"me=e-2 contains=@shColonList |
261 syn region shColon start="^\s*\zs:" end="$" end="\s#"me=e-2 | |
7 | 262 |
22 | 263 " String And Character Constants: {{{1 |
264 "================================ | |
1121 | 265 syn match shNumber "-\=\<\d\+\>#\=" |
266 syn match shCtrlSeq "\\\d\d\d\|\\[abcfnrtv0]" contained | |
167 | 267 if exists("b:is_bash") |
2034 | 268 syn match shSpecial "\\\o\o\o\|\\x\x\x\|\\c[^"]\|\\[abefnrtv]" contained |
167 | 269 endif |
270 if exists("b:is_bash") | |
2473
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
271 syn region shExSingleQuote matchgroup=shQuote start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial |
2497 | 272 syn region shExDoubleQuote matchgroup=shQuote start=+\$"+ skip=+\\\\\|\\.\|\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,shSpecial |
167 | 273 else |
1121 | 274 syn region shExSingleQuote matchGroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial |
2497 | 275 syn region shExDoubleQuote matchGroup=Error start=+\$"+ skip=+\\\\\|\\.+ end=+"+ contains=shStringSpecial |
167 | 276 endif |
2473
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
277 syn region shSingleQuote matchgroup=shQuote start=+'+ end=+'+ contains=@Spell |
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
278 syn region shDoubleQuote matchgroup=shQuote start=+"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,@Spell |
1698 | 279 syn match shStringSpecial "[^[:print:] \t]" contained |
1201 | 280 syn match shStringSpecial "\%(\\\\\)*\\[\\"'`$()#]" |
2034 | 281 syn match shSpecial "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shMoreSpecial |
1201 | 282 syn match shSpecial "^\%(\\\\\)*\\[\\"'`$()#]" |
2034 | 283 syn match shMoreSpecial "\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shMoreSpecial contained |
7 | 284 |
22 | 285 " Comments: {{{1 |
286 "========== | |
2034 | 287 syn cluster shCommentGroup contains=shTodo,@Spell |
288 syn keyword shTodo contained COMBAK FIXME TODO XXX | |
289 syn match shComment "^\s*\zs#.*$" contains=@shCommentGroup | |
290 syn match shComment "\s\zs#.*$" contains=@shCommentGroup | |
291 syn match shQuickComment contained "#.*$" | |
7 | 292 |
22 | 293 " Here Documents: {{{1 |
294 " ========================================= | |
7 | 295 if version < 600 |
296 syn region shHereDoc matchgroup=shRedir start="<<\s*\**END[a-zA-Z_0-9]*\**" matchgroup=shRedir end="^END[a-zA-Z_0-9]*$" contains=@shDblQuoteList | |
297 syn region shHereDoc matchgroup=shRedir start="<<-\s*\**END[a-zA-Z_0-9]*\**" matchgroup=shRedir end="^\s*END[a-zA-Z_0-9]*$" contains=@shDblQuoteList | |
298 syn region shHereDoc matchgroup=shRedir start="<<\s*\**EOF\**" matchgroup=shRedir end="^EOF$" contains=@shDblQuoteList | |
299 syn region shHereDoc matchgroup=shRedir start="<<-\s*\**EOF\**" matchgroup=shRedir end="^\s*EOF$" contains=@shDblQuoteList | |
300 syn region shHereDoc matchgroup=shRedir start="<<\s*\**\.\**" matchgroup=shRedir end="^\.$" contains=@shDblQuoteList | |
301 syn region shHereDoc matchgroup=shRedir start="<<-\s*\**\.\**" matchgroup=shRedir end="^\s*\.$" contains=@shDblQuoteList | |
302 | |
1668 | 303 elseif (g:sh_fold_enabled % (s:sh_fold_heredoc * 2))/s:sh_fold_heredoc |
1121 | 304 syn region shHereDoc matchgroup=shRedir fold start="<<\s*\z(\S*\)" matchgroup=shRedir end="^\z1\s*$" contains=@shDblQuoteList |
199 | 305 syn region shHereDoc matchgroup=shRedir fold start="<<\s*\"\z(\S*\)\"" matchgroup=shRedir end="^\z1\s*$" |
306 syn region shHereDoc matchgroup=shRedir fold start="<<\s*'\z(\S*\)'" matchgroup=shRedir end="^\z1\s*$" | |
307 syn region shHereDoc matchgroup=shRedir fold start="<<-\s*\z(\S*\)" matchgroup=shRedir end="^\s*\z1\s*$" contains=@shDblQuoteList | |
308 syn region shHereDoc matchgroup=shRedir fold start="<<-\s*\"\z(\S*\)\"" matchgroup=shRedir end="^\s*\z1\s*$" | |
309 syn region shHereDoc matchgroup=shRedir fold start="<<-\s*'\z(\S*\)'" matchgroup=shRedir end="^\s*\z1\s*$" | |
310 syn region shHereDoc matchgroup=shRedir fold start="<<\s*\\\_$\_s*\z(\S*\)" matchgroup=shRedir end="^\z1\s*$" | |
311 syn region shHereDoc matchgroup=shRedir fold start="<<\s*\\\_$\_s*\"\z(\S*\)\"" matchgroup=shRedir end="^\z1\s*$" | |
312 syn region shHereDoc matchgroup=shRedir fold start="<<-\s*\\\_$\_s*'\z(\S*\)'" matchgroup=shRedir end="^\s*\z1\s*$" | |
313 syn region shHereDoc matchgroup=shRedir fold start="<<-\s*\\\_$\_s*\z(\S*\)" matchgroup=shRedir end="^\s*\z1\s*$" | |
314 syn region shHereDoc matchgroup=shRedir fold start="<<-\s*\\\_$\_s*\"\z(\S*\)\"" matchgroup=shRedir end="^\s*\z1\s*$" | |
315 syn region shHereDoc matchgroup=shRedir fold start="<<\s*\\\_$\_s*'\z(\S*\)'" matchgroup=shRedir end="^\z1\s*$" | |
1121 | 316 syn region shHereDoc matchgroup=shRedir fold start="<<\\\z(\S*\)" matchgroup=shRedir end="^\z1\s*$" |
7 | 317 |
318 else | |
199 | 319 syn region shHereDoc matchgroup=shRedir start="<<\s*\\\=\z(\S*\)" matchgroup=shRedir end="^\z1\s*$" contains=@shDblQuoteList |
320 syn region shHereDoc matchgroup=shRedir start="<<\s*\"\z(\S*\)\"" matchgroup=shRedir end="^\z1\s*$" | |
321 syn region shHereDoc matchgroup=shRedir start="<<-\s*\z(\S*\)" matchgroup=shRedir end="^\s*\z1\s*$" contains=@shDblQuoteList | |
322 syn region shHereDoc matchgroup=shRedir start="<<-\s*'\z(\S*\)'" matchgroup=shRedir end="^\s*\z1\s*$" | |
323 syn region shHereDoc matchgroup=shRedir start="<<\s*'\z(\S*\)'" matchgroup=shRedir end="^\z1\s*$" | |
324 syn region shHereDoc matchgroup=shRedir start="<<-\s*\"\z(\S*\)\"" matchgroup=shRedir end="^\s*\z1\s*$" | |
325 syn region shHereDoc matchgroup=shRedir start="<<\s*\\\_$\_s*\z(\S*\)" matchgroup=shRedir end="^\z1\s*$" | |
326 syn region shHereDoc matchgroup=shRedir start="<<-\s*\\\_$\_s*\z(\S*\)" matchgroup=shRedir end="^\s*\z1\s*$" | |
327 syn region shHereDoc matchgroup=shRedir start="<<-\s*\\\_$\_s*'\z(\S*\)'" matchgroup=shRedir end="^\s*\z1\s*$" | |
328 syn region shHereDoc matchgroup=shRedir start="<<\s*\\\_$\_s*'\z(\S*\)'" matchgroup=shRedir end="^\z1\s*$" | |
329 syn region shHereDoc matchgroup=shRedir start="<<\s*\\\_$\_s*\"\z(\S*\)\"" matchgroup=shRedir end="^\z1\s*$" | |
330 syn region shHereDoc matchgroup=shRedir start="<<-\s*\\\_$\_s*\"\z(\S*\)\"" matchgroup=shRedir end="^\s*\z1\s*$" | |
1121 | 331 syn region shHereDoc matchgroup=shRedir start="<<\\\z(\S*\)" matchgroup=shRedir end="^\z1\s*$" |
7 | 332 endif |
333 | |
22 | 334 " Here Strings: {{{1 |
335 " ============= | |
336 if exists("b:is_bash") | |
337 syn match shRedir "<<<" | |
338 endif | |
339 | |
340 " Identifiers: {{{1 | |
341 "============= | |
1668 | 342 syn match shSetOption "\s\zs[-+][a-zA-Z0-9]\+\>" contained |
343 syn match shVariable "\<\([bwglsav]:\)\=[a-zA-Z0-9.!@_%+,]*\ze=" nextgroup=shSetIdentifier | |
2497 | 344 syn match shSetIdentifier "=" contained nextgroup=shPattern,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shSingleQuote,shExSingleQuote |
7 | 345 if exists("b:is_bash") |
2473
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
346 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 |
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
347 syn region shSetList oneline matchgroup=shSet start="\<set\>\ze[^/]" end="\ze[;|)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList |
7 | 348 elseif exists("b:is_kornshell") |
2473
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
349 syn region shSetList oneline matchgroup=shSet start="\<\(typeset\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList |
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
350 syn region shSetList oneline matchgroup=shSet start="\<set\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList |
7 | 351 else |
2473
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
352 syn region shSetList oneline matchgroup=shSet start="\<\(set\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList |
7 | 353 endif |
354 | |
22 | 355 " Functions: {{{1 |
1668 | 356 if !exists("g:is_posix") |
357 syn keyword shFunctionKey function skipwhite skipnl nextgroup=shFunctionTwo | |
358 endif | |
359 | |
360 if exists("b:is_bash") | |
361 if (g:sh_fold_enabled % (s:sh_fold_functions * 2))/s:sh_fold_functions | |
362 syn region shFunctionOne fold matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*{" end="}" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment | |
363 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 | |
364 else | |
365 syn region shFunctionOne matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*{" end="}" contains=@shFunctionList | |
366 syn region shFunctionTwo matchgroup=shFunction start="\h[-a-zA-Z_0-9]*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained | |
367 endif | |
7 | 368 else |
1668 | 369 if (g:sh_fold_enabled % (s:sh_fold_functions * 2))/s:sh_fold_functions |
370 syn region shFunctionOne fold matchgroup=shFunction start="^\s*\h\w*\s*()\_s*{" end="}" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment | |
371 syn region shFunctionTwo fold matchgroup=shFunction start="\h\w*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment | |
372 else | |
373 syn region shFunctionOne matchgroup=shFunction start="^\s*\h\w*\s*()\_s*{" end="}" contains=@shFunctionList | |
374 syn region shFunctionTwo matchgroup=shFunction start="\h\w*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained | |
375 endif | |
7 | 376 endif |
377 | |
22 | 378 " Parameter Dereferencing: {{{1 |
379 " ======================== | |
36 | 380 syn match shDerefSimple "\$\%(\h\w*\|\d\)" |
7 | 381 syn region shDeref matchgroup=PreProc start="\${" end="}" contains=@shDerefList,shDerefVarArray |
382 syn match shDerefWordError "[^}$[]" contained | |
383 syn match shDerefSimple "\$[-#*@!?]" | |
384 syn match shDerefSimple "\$\$" | |
385 if exists("b:is_bash") || exists("b:is_kornshell") | |
386 syn region shDeref matchgroup=PreProc start="\${##\=" end="}" contains=@shDerefList | |
1668 | 387 syn region shDeref matchgroup=PreProc start="\${\$\$" end="}" contains=@shDerefList |
7 | 388 endif |
389 | |
22 | 390 " bash: ${!prefix*} and ${#parameter}: {{{1 |
391 " ==================================== | |
7 | 392 if exists("b:is_bash") |
393 syn region shDeref matchgroup=PreProc start="\${!" end="\*\=}" contains=@shDerefList,shDerefOp | |
394 syn match shDerefVar contained "{\@<=!\w\+" nextgroup=@shDerefVarList | |
395 endif | |
396 | |
397 syn match shDerefSpecial contained "{\@<=[-*@?0]" nextgroup=shDerefOp,shDerefOpError | |
398 syn match shDerefSpecial contained "\({[#!]\)\@<=[[:alnum:]*@_]\+" nextgroup=@shDerefVarList,shDerefOp | |
399 syn match shDerefVar contained "{\@<=\w\+" nextgroup=@shDerefVarList | |
400 | |
22 | 401 " sh ksh bash : ${var[... ]...} array reference: {{{1 |
7 | 402 syn region shDerefVarArray contained matchgroup=shDeref start="\[" end="]" contains=@shCommandSubList nextgroup=shDerefOp,shDerefOpError |
403 | |
22 | 404 " Special ${parameter OPERATOR word} handling: {{{1 |
7 | 405 " sh ksh bash : ${parameter:-word} word is default value |
406 " sh ksh bash : ${parameter:=word} assign word as default value | |
407 " sh ksh bash : ${parameter:?word} display word if parameter is null | |
408 " sh ksh bash : ${parameter:+word} use word if parameter is not null, otherwise nothing | |
409 " ksh bash : ${parameter#pattern} remove small left pattern | |
410 " ksh bash : ${parameter##pattern} remove large left pattern | |
411 " ksh bash : ${parameter%pattern} remove small right pattern | |
412 " ksh bash : ${parameter%%pattern} remove large right pattern | |
413 syn cluster shDerefPatternList contains=shDerefPattern,shDerefString | |
414 syn match shDerefOpError contained ":[[:punct:]]" | |
415 syn match shDerefOp contained ":\=[-=?]" nextgroup=@shDerefPatternList | |
416 syn match shDerefOp contained ":\=+" nextgroup=@shDerefPatternList | |
417 if exists("b:is_bash") || exists("b:is_kornshell") | |
418 syn match shDerefOp contained "#\{1,2}" nextgroup=@shDerefPatternList | |
419 syn match shDerefOp contained "%\{1,2}" nextgroup=@shDerefPatternList | |
482 | 420 syn match shDerefPattern contained "[^{}]\+" contains=shDeref,shDerefSimple,shDerefPattern,shDerefString,shCommandSub,shDerefEscape nextgroup=shDerefPattern |
7 | 421 syn region shDerefPattern contained start="{" end="}" contains=shDeref,shDerefSimple,shDerefString,shCommandSub nextgroup=shDerefPattern |
482 | 422 syn match shDerefEscape contained '\%(\\\\\)*\\.' |
7 | 423 endif |
2473
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
424 syn region shDerefString contained matchgroup=shDerefDelim start=+\%(\\\)\@<!'+ end=+'+ contains=shStringSpecial |
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
425 syn region shDerefString contained matchgroup=shDerefDelim start=+\%(\\\)\@<!"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial |
1668 | 426 syn match shDerefString contained "\\["']" nextgroup=shDerefPattern |
7 | 427 |
428 if exists("b:is_bash") | |
482 | 429 " bash : ${parameter:offset} |
430 " bash : ${parameter:offset:length} | |
7 | 431 syn region shDerefOp contained start=":[$[:alnum:]_]"me=e-1 end=":"me=e-1 end="}"me=e-1 contains=@shCommandSubList nextgroup=shDerefPOL |
482 | 432 syn match shDerefPOL contained ":[^}]\+" contains=@shCommandSubList |
433 | |
434 " bash : ${parameter//pattern/string} | |
435 " bash : ${parameter//pattern} | |
436 syn match shDerefPPS contained '/\{1,2}' nextgroup=shDerefPPSleft | |
557 | 437 syn region shDerefPPSleft contained start='.' skip=@\%(\\\)\/@ matchgroup=shDerefOp end='/' end='\ze}' nextgroup=shDerefPPSright contains=@shCommandSubList |
482 | 438 syn region shDerefPPSright contained start='.' end='\ze}' contains=@shCommandSubList |
7 | 439 endif |
440 | |
1668 | 441 " Arithmetic Parenthesized Expressions: {{{1 |
442 syn region shParen matchgroup=shArithRegion start='(\ze[^(]' end=')' contains=@shArithParenList | |
443 | |
22 | 444 " Useful sh Keywords: {{{1 |
445 " =================== | |
7 | 446 syn keyword shStatement break cd chdir continue eval exec exit kill newgrp pwd read readonly return shift test trap ulimit umask wait |
447 syn keyword shConditional contained elif else then | |
448 syn keyword shCondError elif else then | |
449 | |
22 | 450 " Useful ksh Keywords: {{{1 |
451 " ==================== | |
7 | 452 if exists("b:is_kornshell") || exists("b:is_bash") |
2473
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
453 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 |
1668 | 454 if exists("g:is_posix") |
455 syn keyword shStatement command | |
456 else | |
457 syn keyword shStatement time | |
458 endif | |
7 | 459 |
22 | 460 " Useful bash Keywords: {{{1 |
461 " ===================== | |
7 | 462 if exists("b:is_bash") |
463 syn keyword shStatement bind builtin dirs disown enable help local logout popd pushd shopt source | |
464 else | |
465 syn keyword shStatement login newgrp | |
466 endif | |
467 endif | |
468 | |
22 | 469 " Synchronization: {{{1 |
470 " ================ | |
7 | 471 if !exists("sh_minlines") |
472 let sh_minlines = 200 | |
473 endif | |
474 if !exists("sh_maxlines") | |
475 let sh_maxlines = 2 * sh_minlines | |
476 endif | |
477 exec "syn sync minlines=" . sh_minlines . " maxlines=" . sh_maxlines | |
478 syn sync match shCaseEsacSync grouphere shCaseEsac "\<case\>" | |
479 syn sync match shCaseEsacSync groupthere shCaseEsac "\<esac\>" | |
480 syn sync match shDoSync grouphere shDo "\<do\>" | |
481 syn sync match shDoSync groupthere shDo "\<done\>" | |
482 syn sync match shForSync grouphere shFor "\<for\>" | |
483 syn sync match shForSync groupthere shFor "\<in\>" | |
484 syn sync match shIfSync grouphere shIf "\<if\>" | |
485 syn sync match shIfSync groupthere shIf "\<fi\>" | |
486 syn sync match shUntilSync grouphere shRepeat "\<until\>" | |
487 syn sync match shWhileSync grouphere shRepeat "\<while\>" | |
488 | |
22 | 489 " Default Highlighting: {{{1 |
490 " ===================== | |
7 | 491 hi def link shArithRegion shShellVariables |
167 | 492 hi def link shBeginHere shRedir |
7 | 493 hi def link shCaseBar shConditional |
494 hi def link shCaseCommandSub shCommandSub | |
495 hi def link shCaseDoubleQuote shDoubleQuote | |
167 | 496 hi def link shCaseIn shConditional |
2473
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
497 hi def link shQuote shOperator |
7 | 498 hi def link shCaseSingleQuote shSingleQuote |
499 hi def link shCaseStart shConditional | |
500 hi def link shCmdSubRegion shShellVariables | |
2034 | 501 hi def link shColon shComment |
167 | 502 hi def link shDerefOp shOperator |
503 hi def link shDerefPOL shDerefOp | |
482 | 504 hi def link shDerefPPS shDerefOp |
7 | 505 hi def link shDeref shShellVariables |
2473
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
506 hi def link shDerefDelim shOperator |
7 | 507 hi def link shDerefSimple shDeref |
508 hi def link shDerefSpecial shDeref | |
509 hi def link shDerefString shDoubleQuote | |
167 | 510 hi def link shDerefVar shDeref |
7 | 511 hi def link shDoubleQuote shString |
512 hi def link shEcho shString | |
2473
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
513 hi def link shEchoDelim shOperator |
1668 | 514 hi def link shEchoQuote shString |
7 | 515 hi def link shEmbeddedEcho shString |
1668 | 516 hi def link shEscape shCommandSub |
2497 | 517 hi def link shExDoubleQuote shDoubleQuote |
167 | 518 hi def link shExSingleQuote shSingleQuote |
1668 | 519 hi def link shFunction Function |
7 | 520 hi def link shHereDoc shString |
167 | 521 hi def link shHerePayload shHereDoc |
7 | 522 hi def link shLoop shStatement |
2034 | 523 hi def link shMoreSpecial shSpecial |
7 | 524 hi def link shOption shCommandSub |
525 hi def link shPattern shString | |
1668 | 526 hi def link shParen shArithmetic |
7 | 527 hi def link shPosnParm shShellVariables |
1668 | 528 hi def link shQuickComment shComment |
7 | 529 hi def link shRange shOperator |
530 hi def link shRedir shOperator | |
2473
d55e70cabe2c
Syntax file updates. (Charles Campbell)
Bram Moolenaar <bram@vim.org>
parents:
2357
diff
changeset
|
531 hi def link shSetListDelim shOperator |
1668 | 532 hi def link shSetOption shOption |
7 | 533 hi def link shSingleQuote shString |
534 hi def link shSource shOperator | |
535 hi def link shStringSpecial shSpecial | |
536 hi def link shSubShRegion shOperator | |
537 hi def link shTestOpr shConditional | |
1121 | 538 hi def link shTestPattern shString |
539 hi def link shTestDoubleQuote shString | |
540 hi def link shTestSingleQuote shString | |
7 | 541 hi def link shVariable shSetList |
542 hi def link shWrapLineOperator shOperator | |
543 | |
544 if exists("b:is_bash") | |
545 hi def link bashAdminStatement shStatement | |
546 hi def link bashSpecialVariables shShellVariables | |
547 hi def link bashStatement shStatement | |
199 | 548 hi def link shFunctionParen Delimiter |
549 hi def link shFunctionDelim Delimiter | |
7 | 550 endif |
551 if exists("b:is_kornshell") | |
552 hi def link kshSpecialVariables shShellVariables | |
553 hi def link kshStatement shStatement | |
199 | 554 hi def link shFunctionParen Delimiter |
7 | 555 endif |
556 | |
557 hi def link shCaseError Error | |
558 hi def link shCondError Error | |
559 hi def link shCurlyError Error | |
560 hi def link shDerefError Error | |
561 hi def link shDerefOpError Error | |
562 hi def link shDerefWordError Error | |
563 hi def link shDoError Error | |
564 hi def link shEsacError Error | |
565 hi def link shIfError Error | |
566 hi def link shInError Error | |
567 hi def link shParenError Error | |
568 hi def link shTestError Error | |
569 if exists("b:is_kornshell") | |
570 hi def link shDTestError Error | |
571 endif | |
572 | |
573 hi def link shArithmetic Special | |
574 hi def link shCharClass Identifier | |
575 hi def link shSnglCase Statement | |
576 hi def link shCommandSub Special | |
577 hi def link shComment Comment | |
578 hi def link shConditional Conditional | |
1121 | 579 hi def link shCtrlSeq Special |
7 | 580 hi def link shExprRegion Delimiter |
199 | 581 hi def link shFunctionKey Function |
7 | 582 hi def link shFunctionName Function |
583 hi def link shNumber Number | |
584 hi def link shOperator Operator | |
585 hi def link shRepeat Repeat | |
586 hi def link shSet Statement | |
587 hi def link shSetList Identifier | |
588 hi def link shShellVariables PreProc | |
589 hi def link shSpecial Special | |
590 hi def link shStatement Statement | |
591 hi def link shString String | |
592 hi def link shTodo Todo | |
593 hi def link shAlias Identifier | |
594 | |
22 | 595 " Set Current Syntax: {{{1 |
596 " =================== | |
7 | 597 if exists("b:is_bash") |
598 let b:current_syntax = "bash" | |
599 elseif exists("b:is_kornshell") | |
600 let b:current_syntax = "ksh" | |
601 else | |
602 let b:current_syntax = "sh" | |
603 endif | |
604 | |
22 | 605 " vim: ts=16 fdm=marker |