annotate runtime/syntax/sh.vim @ 827:fd1b3406fd1c v7.0d02

updated for version 7.0d02
author vimboss
date Wed, 12 Apr 2006 21:52:12 +0000
parents 57c7403f6599
children 01583c79d5f4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: shell (sh) Korn shell (ksh) bash (sh)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
827
fd1b3406fd1c updated for version 7.0d02
vimboss
parents: 820
diff changeset
5 " Last Change: Apr 12, 2006
fd1b3406fd1c updated for version 7.0d02
vimboss
parents: 820
diff changeset
6 " Version: 83
507
a1059cda45f2 updated for version 7.0142
vimboss
parents: 482
diff changeset
7 " URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 "
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
9 " Using the following VIM variables: {{{1
557
862863033fdd updated for version 7.0158
vimboss
parents: 507
diff changeset
10 " b:is_kornshell if defined, enhance with kornshell/POSIX syntax
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " b:is_bash if defined, enhance with bash syntax
557
862863033fdd updated for version 7.0158
vimboss
parents: 507
diff changeset
12 " g:is_kornshell if neither b:is_kornshell or b:is_bash is
862863033fdd updated for version 7.0158
vimboss
parents: 507
diff changeset
13 " defined, then if g:is_kornshell is set
862863033fdd updated for version 7.0158
vimboss
parents: 507
diff changeset
14 " enhance with kornshell/POSIX syntax highlighting
862863033fdd updated for version 7.0158
vimboss
parents: 507
diff changeset
15 " g:is_bash if none of the previous three variables are
862863033fdd updated for version 7.0158
vimboss
parents: 507
diff changeset
16 " defined, then if g:is_bash is set enhance with
862863033fdd updated for version 7.0158
vimboss
parents: 507
diff changeset
17 " bash syntax highlighting
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " g:sh_fold_enabled if non-zero, syntax folding is enabled
557
862863033fdd updated for version 7.0158
vimboss
parents: 507
diff changeset
19 " g:sh_minlines sets up syn sync minlines (dflt: 200)
862863033fdd updated for version 7.0158
vimboss
parents: 507
diff changeset
20 " g:sh_maxlines sets up syn sync maxlines (dflt: 2x sh_minlines)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 " This file includes many ideas from Éric Brunet (eric.brunet@ens.fr)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
24 " For version 5.x: Clear all syntax items {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
32 " handling /bin/sh with is_kornshell/is_sh {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 " b:is_sh is set when "#! /bin/sh" is found;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 " However, it often is just a masquerade by bash (typically Linux)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 " or kornshell (typically workstations with Posix "sh").
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 " So, when the user sets "is_bash" or "is_kornshell",
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 " a b:is_sh is converted into b:is_bash/b:is_kornshell,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " respectively.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 if !exists("b:is_kornshell") && !exists("b:is_bash")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 if exists("is_kornshell")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 let b:is_kornshell= 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 if exists("b:is_sh")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 unlet b:is_sh
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 elseif exists("is_bash")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 let b:is_bash= 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 if exists("b:is_sh")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 unlet b:is_sh
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 let b:is_sh= 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
199
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
55 " set up default g:sh_fold_enabled {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 if !exists("g:sh_fold_enabled")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 let g:sh_fold_enabled= 0
36
125e80798a85 updated for version 7.0021
vimboss
parents: 22
diff changeset
58 elseif g:sh_fold_enabled != 0 && !has("folding")
125e80798a85 updated for version 7.0021
vimboss
parents: 22
diff changeset
59 let g:sh_fold_enabled= 0
199
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
60 echomsg "Ignoring g:sh_fold_enabled=".g:sh_fold_enabled."; need to re-compile vim for +fold support"
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
61 endif
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
62 if g:sh_fold_enabled && &fdm == "manual"
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
63 set fdm=syntax
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
199
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
66 " sh syntax is case sensitive {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
69 " Clusters: contains=@... clusters {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 "==================================
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
71 syn cluster shCaseEsacList contains=shCaseStart,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote,shSpecial
199
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
72 syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shSpecial
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn cluster shColonList contains=@shCaseList
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
74 syn cluster shCommandSubList contains=shArithmetic,shDeref,shDerefSimple,shNumber,shOperator,shPosnParm,shSpecial,shExSingleQuote,shSingleQuote,shDoubleQuote,shStatement,shVariable,shSubSh,shAlias,shTest
464
3b705e71c7b0 updated for version 7.0124
vimboss
parents: 230
diff changeset
75 syn cluster shCurlyList contains=shNumber,shComma,shDeref,shDerefSimple,shDerefSpecial
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 syn cluster shDblQuoteList contains=shCommandSub,shDeref,shDerefSimple,shSpecial,shPosnParm
482
6f8b578776ab updated for version 7.0131
vimboss
parents: 464
diff changeset
77 syn cluster shDerefList contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError,shDerefPPS
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 syn cluster shDerefVarList contains=shDerefOp,shDerefVarArray,shDerefOpError
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
79 syn cluster shEchoList contains=shArithmetic,shCommandSub,shDeref,shDerefSimple,shExpr,shExSingleQuote,shSingleQuote,shDoubleQuote,shSpecial
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
80 syn cluster shExprList1 contains=shCharClass,shNumber,shOperator,shExSingleQuote,shSingleQuote,shDoubleQuote,shSpecial,shExpr,shDblBrace,shDeref,shDerefSimple
119
e8f07016e34d updated for version 7.0042
vimboss
parents: 36
diff changeset
81 syn cluster shExprList2 contains=@shExprList1,@shCaseList,shTest
820
57c7403f6599 updated for version 7.0c11
vimboss
parents: 698
diff changeset
82 syn cluster shFunctionList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shSpecial,shOperator,shFunctionStart
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 syn cluster shHereBeginList contains=@shCommandSubList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 syn cluster shHereList contains=shBeginHere,shHerePayload
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 syn cluster shHereListDQ contains=shBeginHere,@shDblQuoteList,shHerePayload
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
86 syn cluster shIdList contains=shCommandSub,shWrapLineOperator,shIdWhiteSpace,shDeref,shDerefSimple,shSpecial,shRedir,shExSingleQuote,shSingleQuote,shDoubleQuote,shExpr
119
e8f07016e34d updated for version 7.0042
vimboss
parents: 36
diff changeset
87 syn cluster shLoopList contains=@shCaseList,shTestOpr,shExpr,shDblBrace,shConditional,shCaseEsac,shTest
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 syn cluster shSubShList contains=@shCaseList
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
89 syn cluster shTestList contains=shCharClass,shComment,shCommandSub,shDeref,shDerefSimple,shDoubleQuote,shExpr,shExpr,shNumber,shOperator,shExSingleQuote,shSingleQuote,shSpecial,shTestOpr,shTest
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
92 " Echo: {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 " ====
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 " This one is needed INSIDE a CommandSub, so that `echo bla` be correct
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 syn region shEcho matchgroup=shStatement start="\<echo\>" skip="\\$" matchgroup=shOperator end="$" matchgroup=NONE end="[<>;&|()]"me=e-1 end="\d[<>]"me=e-2 end="#"me=e-1 contains=@shEchoList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 syn region shEcho matchgroup=shStatement start="\<print\>" skip="\\$" matchgroup=shOperator end="$" matchgroup=NONE end="[<>;&|()]"me=e-1 end="\d[<>]"me=e-2 end="#"me=e-1 contains=@shEchoList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 " This must be after the strings, so that bla \" be correct
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
99 syn region shEmbeddedEcho contained matchgroup=shStatement start="\<print\>" skip="\\$" matchgroup=shOperator end="$" matchgroup=NONE end="[<>;&|`)]"me=e-1 end="\d[<>]"me=e-2 end="#"me=e-1 contains=shNumber,shExSingleQuote,shSingleQuote,shDeref,shDerefSimple,shSpecialVar,shSpecial,shOperator,shDoubleQuote,shCharClass
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
101 " Alias: {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 " =====
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 if exists("b:is_kornshell") || exists("b:is_bash")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 syn match shStatement "\<alias\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\w\+\)\@=" skip="\\$" end="\>\|`"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\w\+=\)\@=" skip="\\$" end="="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
109 " Error Codes: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
110 " ============
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 syn match shDoError "\<done\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 syn match shIfError "\<fi\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 syn match shInError "\<in\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 syn match shCaseError ";;"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 syn match shEsacError "\<esac\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 syn match shCurlyError "}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 syn match shParenError ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 if exists("b:is_kornshell")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 syn match shDTestError "]]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 syn match shTestError "]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
123 " Options Interceptor: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
124 " ====================
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 syn match shOption "\s[\-+][a-zA-Z0-9]\+\>"ms=s+1
698
e402b0af6083 updated for version 7.0211
vimboss
parents: 659
diff changeset
126 syn match shOption "\s--[^ \t$`'"|]\+"ms=s+1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
128 " Operators: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
129 " ==========
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 syn match shOperator "[!&;|]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 syn match shOperator "\[[[^:]\|\]]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 syn match shOperator "!\==" skipwhite nextgroup=shPattern
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
133 syn match shPattern "\<\S\+\())\)\@=" contained contains=shExSingleQuote,shSingleQuote,shDoubleQuote,shDeref
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
135 " Subshells: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
136 " ==========
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 syn region shExpr transparent matchgroup=shExprRegion start="{" end="}" contains=@shExprList2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 syn region shSubSh transparent matchgroup=shSubShRegion start="(" end=")" contains=@shSubShList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
140 " Tests: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
141 "=======
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 "syn region shExpr transparent matchgroup=shRange start="\[" skip=+\\\\\|\\$+ end="\]" contains=@shTestList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 syn region shExpr matchgroup=shRange start="\[" skip=+\\\\\|\\$+ end="\]" contains=@shTestList
119
e8f07016e34d updated for version 7.0042
vimboss
parents: 36
diff changeset
144 syn region shTest transparent matchgroup=shStatement start="\<test\>" skip=+\\\\\|\\$+ matchgroup=NONE end="[;&|]"me=e-1 end="$" contains=@shExprList1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 syn match shTestOpr contained "<=\|>=\|!=\|==\|-.\>\|-\(nt\|ot\|ef\|eq\|ne\|lt\|le\|gt\|ge\)\>\|[!=<>]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 if exists("b:is_kornshell") || exists("b:is_bash")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 syn region shDblBrace matchgroup=Delimiter start="\[\[" skip=+\\\\\|\\$+ end="\]\]" contains=@shTestList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 syn region shDblParen matchgroup=Delimiter start="((" skip=+\\\\\|\\$+ end="))" contains=@shTestList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
151 " Character Class In Range: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
152 " =========================
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 syn match shCharClass contained "\[:\(backspace\|escape\|return\|xdigit\|alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|tab\):\]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
155 " Loops: do, if, while, until {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
156 " ======
820
57c7403f6599 updated for version 7.0c11
vimboss
parents: 698
diff changeset
157 if g:sh_fold_enabled
57c7403f6599 updated for version 7.0c11
vimboss
parents: 698
diff changeset
158 syn region shDo fold transparent matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>" contains=@shLoopList
57c7403f6599 updated for version 7.0c11
vimboss
parents: 698
diff changeset
159 syn region shIf fold transparent matchgroup=shConditional start="\<if\>" matchgroup=shConditional end="\<;\_s*then\>" end="\<fi\>" contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey
57c7403f6599 updated for version 7.0c11
vimboss
parents: 698
diff changeset
160 syn region shFor fold matchgroup=shLoop start="\<for\>" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn
57c7403f6599 updated for version 7.0c11
vimboss
parents: 698
diff changeset
161 else
57c7403f6599 updated for version 7.0c11
vimboss
parents: 698
diff changeset
162 syn region shDo transparent matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>" contains=@shLoopList
57c7403f6599 updated for version 7.0c11
vimboss
parents: 698
diff changeset
163 syn region shIf transparent matchgroup=shConditional start="\<if\>" matchgroup=shConditional end="\<;\_s*then\>" end="\<fi\>" contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey
57c7403f6599 updated for version 7.0c11
vimboss
parents: 698
diff changeset
164 syn region shFor matchgroup=shLoop start="\<for\>" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn
57c7403f6599 updated for version 7.0c11
vimboss
parents: 698
diff changeset
165 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 if exists("b:is_kornshell") || exists("b:is_bash")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 syn cluster shCaseList add=shRepeat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 syn region shRepeat matchgroup=shLoop start="\<while\>" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen,shDblBrace
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 syn region shRepeat matchgroup=shLoop start="\<until\>" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen,shDblBrace
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 syn region shCaseEsac matchgroup=shConditional start="\<select\>" matchgroup=shConditional end="\<in\>" end="\<do\>" contains=@shLoopList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 syn region shRepeat matchgroup=shLoop start="\<while\>" end="\<do\>"me=e-2 contains=@shLoopList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 syn region shRepeat matchgroup=shLoop start="\<until\>" end="\<do\>"me=e-2 contains=@shLoopList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 endif
464
3b705e71c7b0 updated for version 7.0124
vimboss
parents: 230
diff changeset
175 syn region shCurlyIn contained matchgroup=Delimiter start="{" end="}" contains=@shCurlyList
3b705e71c7b0 updated for version 7.0124
vimboss
parents: 230
diff changeset
176 syn match shComma contained ","
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
178 " Case: case...esac {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 " ====
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
180 syn match shCaseBar contained skipwhite "[^|"`'()]\{-}|"hs=e nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 syn match shCaseStart contained skipwhite skipnl "(" nextgroup=shCase,shCaseBar
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 622
diff changeset
182 syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="[^#$()'"]\{-})"ms=s,hs=e end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment
820
57c7403f6599 updated for version 7.0c11
vimboss
parents: 698
diff changeset
183 if g:sh_fold_enabled
57c7403f6599 updated for version 7.0c11
vimboss
parents: 698
diff changeset
184 syn region shCaseEsac fold matchgroup=shConditional start="\<case\>" end="\<esac\>" contains=@shCaseEsacList
57c7403f6599 updated for version 7.0c11
vimboss
parents: 698
diff changeset
185 else
57c7403f6599 updated for version 7.0c11
vimboss
parents: 698
diff changeset
186 syn region shCaseEsac matchgroup=shConditional start="\<case\>" end="\<esac\>" contains=@shCaseEsacList
57c7403f6599 updated for version 7.0c11
vimboss
parents: 698
diff changeset
187 endif
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
188 syn keyword shCaseIn contained skipwhite skipnl in nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
189 if exists("b:is_bash")
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
190 syn region shCaseExSingleQuote matchgroup=shOperator start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial skipwhite skipnl nextgroup=shCaseBar contained
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
191 else
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
192 syn region shCaseExSingleQuote matchgroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
193 endif
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 622
diff changeset
194 syn region shCaseSingleQuote matchgroup=shOperator start=+'+ end=+'+ contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 syn region shCaseDoubleQuote matchgroup=shOperator start=+"+ skip=+\\\\\|\\.+ end=+"+ contains=@shDblQuoteList,shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 syn region shCaseCommandSub start=+`+ skip=+\\\\\|\\.+ end=+`+ contains=@shCommandSubList skipwhite skipnl nextgroup=shCaseBar contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
198 " Misc: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
199 "======
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 syn match shWrapLineOperator "\\$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 syn region shCommandSub start="`" skip="\\\\\|\\." end="`" contains=@shCommandSubList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
203 " $() and $(()): {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 " $(..) is not supported by sh (Bourne shell). However, apparently
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 " some systems (HP?) have as their /bin/sh a (link to) Korn shell
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 " (ie. Posix compliant shell). /bin/ksh should work for those
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 " systems too, however, so the following syntax will flag $(..) as
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 " an Error under /bin/sh. By consensus of vimdev'ers!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 if exists("b:is_kornshell") || exists("b:is_bash")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 syn region shCommandSub matchgroup=shCmdSubRegion start="\$(" skip='\\\\\|\\.' end=")" contains=@shCommandSubList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 syn region shArithmetic matchgroup=shArithRegion start="\$((" skip='\\\\\|\\.' end="))" contains=@shCommandSubList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 syn match shSkipInitWS contained "^\s\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 else
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
214 syn region shCommandSub matchgroup=Error start="\$(" end=")" contains=@shCommandSubList
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 if exists("b:is_bash")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 syn cluster shCommandSubList add=bashSpecialVariables,bashStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 syn cluster shCaseList add=bashAdminStatement,bashStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220 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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221 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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222 syn keyword bashAdminStatement daemon killall killproc nice reload restart start status stop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 if exists("b:is_kornshell")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226 syn cluster shCommandSubList add=kshSpecialVariables,kshStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 syn cluster shCaseList add=kshStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229 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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 syn match shSource "^\.\s"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233 syn match shSource "\s\.\s"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234 syn region shColon start="^\s*:" end="$\|" end="#"me=e-1 contains=@shColonList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
236 " String And Character Constants: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
237 "================================
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238 syn match shNumber "-\=\<\d\+\>"
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
239 if exists("b:is_bash")
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
240 syn match shSpecial "\\\o\o\o\|\\x\x\x\|\\c.\|\\[abefnrtv]" contained
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
241 else
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
242 syn match shSpecial "\\\d\d\d\|\\[abcfnrtv0]" contained
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
243 endif
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
244 if exists("b:is_bash")
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
245 syn region shExSingleQuote matchgroup=shOperator start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
246 else
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
247 syn region shExSingleQuote matchGroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
248 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249 syn region shSingleQuote matchgroup=shOperator start=+'+ end=+'+ contains=shStringSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 syn region shDoubleQuote matchgroup=shOperator start=+"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251 syn match shStringSpecial "[^[:print:]]" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 syn match shSpecial "\\[\\\"\'`$()#]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
254 " Comments: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
255 "==========
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 syn cluster shCommentGroup contains=shTodo,@Spell
827
fd1b3406fd1c updated for version 7.0d02
vimboss
parents: 820
diff changeset
257 syn keyword shTodo contained COMBAK FIXME TODO XXX
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258 syn match shComment "#.*$" contains=@shCommentGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
260 " File Redirection Highlighted As Operators: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
261 "===========================================
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262 syn match shRedir "\d\=>\(&[-0-9]\)\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263 syn match shRedir "\d\=>>-\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 syn match shRedir "\d\=<\(&[-0-9]\)\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265 syn match shRedir "\d<<-\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
267 " Here Documents: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
268 " =========================================
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 syn region shHereDoc matchgroup=shRedir start="<<\s*\**END[a-zA-Z_0-9]*\**" matchgroup=shRedir end="^END[a-zA-Z_0-9]*$" contains=@shDblQuoteList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271 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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272 syn region shHereDoc matchgroup=shRedir start="<<\s*\**EOF\**" matchgroup=shRedir end="^EOF$" contains=@shDblQuoteList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 syn region shHereDoc matchgroup=shRedir start="<<-\s*\**EOF\**" matchgroup=shRedir end="^\s*EOF$" contains=@shDblQuoteList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274 syn region shHereDoc matchgroup=shRedir start="<<\s*\**\.\**" matchgroup=shRedir end="^\.$" contains=@shDblQuoteList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 syn region shHereDoc matchgroup=shRedir start="<<-\s*\**\.\**" matchgroup=shRedir end="^\s*\.$" contains=@shDblQuoteList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277 elseif g:sh_fold_enabled
199
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
278 syn region shHereDoc matchgroup=shRedir fold start="<<\s*\z(\S*\)" matchgroup=shRedir end="^\z1\s*$" contains=@shDblQuoteList
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
279 syn region shHereDoc matchgroup=shRedir fold start="<<\s*\"\z(\S*\)\"" matchgroup=shRedir end="^\z1\s*$"
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
280 syn region shHereDoc matchgroup=shRedir fold start="<<\s*'\z(\S*\)'" matchgroup=shRedir end="^\z1\s*$"
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
281 syn region shHereDoc matchgroup=shRedir fold start="<<-\s*\z(\S*\)" matchgroup=shRedir end="^\s*\z1\s*$" contains=@shDblQuoteList
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
282 syn region shHereDoc matchgroup=shRedir fold start="<<-\s*\"\z(\S*\)\"" matchgroup=shRedir end="^\s*\z1\s*$"
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
283 syn region shHereDoc matchgroup=shRedir fold start="<<-\s*'\z(\S*\)'" matchgroup=shRedir end="^\s*\z1\s*$"
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
284 syn region shHereDoc matchgroup=shRedir fold start="<<\s*\\\_$\_s*\z(\S*\)" matchgroup=shRedir end="^\z1\s*$"
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
285 syn region shHereDoc matchgroup=shRedir fold start="<<\s*\\\_$\_s*\"\z(\S*\)\"" matchgroup=shRedir end="^\z1\s*$"
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
286 syn region shHereDoc matchgroup=shRedir fold start="<<-\s*\\\_$\_s*'\z(\S*\)'" matchgroup=shRedir end="^\s*\z1\s*$"
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
287 syn region shHereDoc matchgroup=shRedir fold start="<<-\s*\\\_$\_s*\z(\S*\)" matchgroup=shRedir end="^\s*\z1\s*$"
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
288 syn region shHereDoc matchgroup=shRedir fold start="<<-\s*\\\_$\_s*\"\z(\S*\)\"" matchgroup=shRedir end="^\s*\z1\s*$"
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
289 syn region shHereDoc matchgroup=shRedir fold start="<<\s*\\\_$\_s*'\z(\S*\)'" matchgroup=shRedir end="^\z1\s*$"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291 else
199
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
292 syn region shHereDoc matchgroup=shRedir start="<<\s*\\\=\z(\S*\)" matchgroup=shRedir end="^\z1\s*$" contains=@shDblQuoteList
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
293 syn region shHereDoc matchgroup=shRedir start="<<\s*\"\z(\S*\)\"" matchgroup=shRedir end="^\z1\s*$"
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
294 syn region shHereDoc matchgroup=shRedir start="<<-\s*\z(\S*\)" matchgroup=shRedir end="^\s*\z1\s*$" contains=@shDblQuoteList
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
295 syn region shHereDoc matchgroup=shRedir start="<<-\s*'\z(\S*\)'" matchgroup=shRedir end="^\s*\z1\s*$"
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
296 syn region shHereDoc matchgroup=shRedir start="<<\s*'\z(\S*\)'" matchgroup=shRedir end="^\z1\s*$"
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
297 syn region shHereDoc matchgroup=shRedir start="<<-\s*\"\z(\S*\)\"" matchgroup=shRedir end="^\s*\z1\s*$"
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
298 syn region shHereDoc matchgroup=shRedir start="<<\s*\\\_$\_s*\z(\S*\)" matchgroup=shRedir end="^\z1\s*$"
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
299 syn region shHereDoc matchgroup=shRedir start="<<-\s*\\\_$\_s*\z(\S*\)" matchgroup=shRedir end="^\s*\z1\s*$"
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
300 syn region shHereDoc matchgroup=shRedir start="<<-\s*\\\_$\_s*'\z(\S*\)'" matchgroup=shRedir end="^\s*\z1\s*$"
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
301 syn region shHereDoc matchgroup=shRedir start="<<\s*\\\_$\_s*'\z(\S*\)'" matchgroup=shRedir end="^\z1\s*$"
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
302 syn region shHereDoc matchgroup=shRedir start="<<\s*\\\_$\_s*\"\z(\S*\)\"" matchgroup=shRedir end="^\z1\s*$"
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
303 syn region shHereDoc matchgroup=shRedir start="<<-\s*\\\_$\_s*\"\z(\S*\)\"" matchgroup=shRedir end="^\s*\z1\s*$"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
306 " Here Strings: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
307 " =============
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
308 if exists("b:is_bash")
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
309 syn match shRedir "<<<"
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
310 endif
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
311
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
312 " Identifiers: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
313 "=============
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
314 syn match shVariable "\<\([bwglsav]:\)\=[a-zA-Z0-9.!@_%+,]*\ze=" nextgroup=shSetIdentifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
315 syn match shIdWhiteSpace contained "\s"
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
316 syn match shSetIdentifier contained "=" nextgroup=shPattern,shDeref,shDerefSimple,shDoubleQuote,shSingleQuote,shExSingleQuote
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
317 if exists("b:is_bash")
119
e8f07016e34d updated for version 7.0042
vimboss
parents: 36
diff changeset
318 syn region shSetList matchgroup=shSet start="\<\(declare\|typeset\|local\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shOperator end="[;&]"me=e-1 matchgroup=NONE end="#\|="me=e-1 contains=@shIdList
e8f07016e34d updated for version 7.0042
vimboss
parents: 36
diff changeset
319 syn region shSetList matchgroup=shSet start="\<set\>[^/]"me=e-1 end="$" end="\\ze[|)]" matchgroup=shOperator end="[;&]"me=e-1 matchgroup=NONE end="[#=]"me=e-1 contains=@shIdList
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320 syn match shSet "\<\(declare\|typeset\|local\|export\|set\|unset\)$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321 elseif exists("b:is_kornshell")
119
e8f07016e34d updated for version 7.0042
vimboss
parents: 36
diff changeset
322 syn region shSetList matchgroup=shSet start="\<\(typeset\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shOperator end="[;&]"me=e-1 matchgroup=NONE end="[#=]"me=e-1 contains=@shIdList
e8f07016e34d updated for version 7.0042
vimboss
parents: 36
diff changeset
323 syn region shSetList matchgroup=shSet start="\<set\>\ze[^/]" end="$\|\ze[})]" matchgroup=shOperator end="[;&]"me=e-1 matchgroup=NONE end="[#=]"me=e-1 contains=@shIdList
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
324 syn match shSet "\<\(typeset\|set\|export\|unset\)$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325 else
119
e8f07016e34d updated for version 7.0042
vimboss
parents: 36
diff changeset
326 syn region shSetList matchgroup=shSet start="\<\(set\|export\|unset\)\>\ze[^/]" end="$\|\ze[|)]" matchgroup=shOperator end="[;&]" matchgroup=NONE end="[#=]"me=e-1 contains=@shIdList
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
327 syn match shStatement "\<\(set\|export\|unset\)$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
328 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
329
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
330 " Functions: {{{1
199
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
331 syn keyword shFunctionKey function skipwhite skipnl nextgroup=shFunctionTwo
820
57c7403f6599 updated for version 7.0c11
vimboss
parents: 698
diff changeset
332 syn match shFunctionStart "^\s*{" contained
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
333 if g:sh_fold_enabled
199
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
334 syn region shFunctionOne transparent fold start="^\s*\h\w*\s*()\_s*\ze{" matchgroup=shFunctionStart end="}" contains=@shFunctionList
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
335 syn region shFunctionTwo transparent fold start="\h\w*\s*\%(()\)\=\_s*\ze{" matchgroup=shFunctionStart end="}" contains=shFunctionKey,@shFunctionList contained
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
336 else
199
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
337 syn region shFunctionOne transparent start="^\s*\h\w*\s*()\_s*\ze{" matchgroup=shFunctionStart end="}" contains=@shFunctionList
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
338 syn region shFunctionTwo transparent start="\h\w*\s*\%(()\)\=\_s*\ze{" matchgroup=shFunctionStart end="}" contains=shFunctionKey,@shFunctionList contained
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
339 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
341 " Parameter Dereferencing: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
342 " ========================
36
125e80798a85 updated for version 7.0021
vimboss
parents: 22
diff changeset
343 syn match shDerefSimple "\$\%(\h\w*\|\d\)"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344 syn region shDeref matchgroup=PreProc start="\${" end="}" contains=@shDerefList,shDerefVarArray
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345 syn match shDerefWordError "[^}$[]" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346 syn match shDerefSimple "\$[-#*@!?]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347 syn match shDerefSimple "\$\$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348 if exists("b:is_bash") || exists("b:is_kornshell")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349 syn region shDeref matchgroup=PreProc start="\${##\=" end="}" contains=@shDerefList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
352 " bash: ${!prefix*} and ${#parameter}: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
353 " ====================================
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354 if exists("b:is_bash")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355 syn region shDeref matchgroup=PreProc start="\${!" end="\*\=}" contains=@shDerefList,shDerefOp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
356 syn match shDerefVar contained "{\@<=!\w\+" nextgroup=@shDerefVarList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
358
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
359 syn match shDerefSpecial contained "{\@<=[-*@?0]" nextgroup=shDerefOp,shDerefOpError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
360 syn match shDerefSpecial contained "\({[#!]\)\@<=[[:alnum:]*@_]\+" nextgroup=@shDerefVarList,shDerefOp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
361 syn match shDerefVar contained "{\@<=\w\+" nextgroup=@shDerefVarList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
362
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
363 " sh ksh bash : ${var[... ]...} array reference: {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
364 syn region shDerefVarArray contained matchgroup=shDeref start="\[" end="]" contains=@shCommandSubList nextgroup=shDerefOp,shDerefOpError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
365
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
366 " Special ${parameter OPERATOR word} handling: {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
367 " sh ksh bash : ${parameter:-word} word is default value
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
368 " sh ksh bash : ${parameter:=word} assign word as default value
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369 " sh ksh bash : ${parameter:?word} display word if parameter is null
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370 " sh ksh bash : ${parameter:+word} use word if parameter is not null, otherwise nothing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371 " ksh bash : ${parameter#pattern} remove small left pattern
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372 " ksh bash : ${parameter##pattern} remove large left pattern
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373 " ksh bash : ${parameter%pattern} remove small right pattern
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
374 " ksh bash : ${parameter%%pattern} remove large right pattern
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
375 syn cluster shDerefPatternList contains=shDerefPattern,shDerefString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
376 syn match shDerefOpError contained ":[[:punct:]]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
377 syn match shDerefOp contained ":\=[-=?]" nextgroup=@shDerefPatternList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
378 syn match shDerefOp contained ":\=+" nextgroup=@shDerefPatternList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
379 if exists("b:is_bash") || exists("b:is_kornshell")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
380 syn match shDerefOp contained "#\{1,2}" nextgroup=@shDerefPatternList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381 syn match shDerefOp contained "%\{1,2}" nextgroup=@shDerefPatternList
482
6f8b578776ab updated for version 7.0131
vimboss
parents: 464
diff changeset
382 syn match shDerefPattern contained "[^{}]\+" contains=shDeref,shDerefSimple,shDerefPattern,shDerefString,shCommandSub,shDerefEscape nextgroup=shDerefPattern
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383 syn region shDerefPattern contained start="{" end="}" contains=shDeref,shDerefSimple,shDerefString,shCommandSub nextgroup=shDerefPattern
482
6f8b578776ab updated for version 7.0131
vimboss
parents: 464
diff changeset
384 syn match shDerefEscape contained '\%(\\\\\)*\\.'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
385 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
386 syn region shDerefString contained matchgroup=shOperator start=+'+ end=+'+ contains=shStringSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
387 syn region shDerefString contained matchgroup=shOperator start=+"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
388 syn match shDerefString contained "\\["']"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
389
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390 if exists("b:is_bash")
482
6f8b578776ab updated for version 7.0131
vimboss
parents: 464
diff changeset
391 " bash : ${parameter:offset}
6f8b578776ab updated for version 7.0131
vimboss
parents: 464
diff changeset
392 " bash : ${parameter:offset:length}
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393 syn region shDerefOp contained start=":[$[:alnum:]_]"me=e-1 end=":"me=e-1 end="}"me=e-1 contains=@shCommandSubList nextgroup=shDerefPOL
482
6f8b578776ab updated for version 7.0131
vimboss
parents: 464
diff changeset
394 syn match shDerefPOL contained ":[^}]\+" contains=@shCommandSubList
6f8b578776ab updated for version 7.0131
vimboss
parents: 464
diff changeset
395
6f8b578776ab updated for version 7.0131
vimboss
parents: 464
diff changeset
396 " bash : ${parameter//pattern/string}
6f8b578776ab updated for version 7.0131
vimboss
parents: 464
diff changeset
397 " bash : ${parameter//pattern}
6f8b578776ab updated for version 7.0131
vimboss
parents: 464
diff changeset
398 syn match shDerefPPS contained '/\{1,2}' nextgroup=shDerefPPSleft
557
862863033fdd updated for version 7.0158
vimboss
parents: 507
diff changeset
399 syn region shDerefPPSleft contained start='.' skip=@\%(\\\)\/@ matchgroup=shDerefOp end='/' end='\ze}' nextgroup=shDerefPPSright contains=@shCommandSubList
482
6f8b578776ab updated for version 7.0131
vimboss
parents: 464
diff changeset
400 syn region shDerefPPSright contained start='.' end='\ze}' contains=@shCommandSubList
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
401 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
403 " Useful sh Keywords: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
404 " ===================
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
405 syn keyword shStatement break cd chdir continue eval exec exit kill newgrp pwd read readonly return shift test trap ulimit umask wait
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
406 syn keyword shConditional contained elif else then
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
407 syn keyword shCondError elif else then
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
408
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
409 " Useful ksh Keywords: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
410 " ====================
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411 if exists("b:is_kornshell") || exists("b:is_bash")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
412 syn keyword shStatement autoload bg false fc fg functions getopts hash history integer jobs let nohup print printf r stop suspend time times true type unalias whence
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
414 " Useful bash Keywords: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
415 " =====================
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416 if exists("b:is_bash")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
417 syn keyword shStatement bind builtin dirs disown enable help local logout popd pushd shopt source
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
419 syn keyword shStatement login newgrp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
420 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
423 " Synchronization: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
424 " ================
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425 if !exists("sh_minlines")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
426 let sh_minlines = 200
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
428 if !exists("sh_maxlines")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429 let sh_maxlines = 2 * sh_minlines
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
430 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431 exec "syn sync minlines=" . sh_minlines . " maxlines=" . sh_maxlines
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
432 syn sync match shCaseEsacSync grouphere shCaseEsac "\<case\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433 syn sync match shCaseEsacSync groupthere shCaseEsac "\<esac\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434 syn sync match shDoSync grouphere shDo "\<do\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435 syn sync match shDoSync groupthere shDo "\<done\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
436 syn sync match shForSync grouphere shFor "\<for\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437 syn sync match shForSync groupthere shFor "\<in\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438 syn sync match shIfSync grouphere shIf "\<if\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
439 syn sync match shIfSync groupthere shIf "\<fi\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440 syn sync match shUntilSync grouphere shRepeat "\<until\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
441 syn sync match shWhileSync grouphere shRepeat "\<while\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
442
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
443 " Default Highlighting: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
444 " =====================
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
445 hi def link shArithRegion shShellVariables
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
446 hi def link shBeginHere shRedir
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
447 hi def link shCaseBar shConditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
448 hi def link shCaseCommandSub shCommandSub
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
449 hi def link shCaseDoubleQuote shDoubleQuote
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
450 hi def link shCaseIn shConditional
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
451 hi def link shCaseSingleQuote shSingleQuote
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
452 hi def link shCaseStart shConditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
453 hi def link shCmdSubRegion shShellVariables
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
454 hi def link shColon shStatement
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
455 hi def link shDerefOp shOperator
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
456 hi def link shDerefPOL shDerefOp
482
6f8b578776ab updated for version 7.0131
vimboss
parents: 464
diff changeset
457 hi def link shDerefPPS shDerefOp
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
458 hi def link shDeref shShellVariables
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
459 hi def link shDerefSimple shDeref
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
460 hi def link shDerefSpecial shDeref
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
461 hi def link shDerefString shDoubleQuote
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
462 hi def link shDerefVar shDeref
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
463 hi def link shDoubleQuote shString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
464 hi def link shEcho shString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
465 hi def link shEmbeddedEcho shString
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
466 hi def link shExSingleQuote shSingleQuote
199
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
467 hi def link shFunctionStart Delimiter
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
468 hi def link shHereDoc shString
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 119
diff changeset
469 hi def link shHerePayload shHereDoc
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
470 hi def link shLoop shStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
471 hi def link shOption shCommandSub
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
472 hi def link shPattern shString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
473 hi def link shPosnParm shShellVariables
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
474 hi def link shRange shOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
475 hi def link shRedir shOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
476 hi def link shSingleQuote shString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
477 hi def link shSource shOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
478 hi def link shStringSpecial shSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
479 hi def link shSubShRegion shOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
480 hi def link shTestOpr shConditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
481 hi def link shVariable shSetList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
482 hi def link shWrapLineOperator shOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
483
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
484 if exists("b:is_bash")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
485 hi def link bashAdminStatement shStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
486 hi def link bashSpecialVariables shShellVariables
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
487 hi def link bashStatement shStatement
199
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
488 hi def link shFunctionParen Delimiter
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
489 hi def link shFunctionDelim Delimiter
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
490 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
491 if exists("b:is_kornshell")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
492 hi def link kshSpecialVariables shShellVariables
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
493 hi def link kshStatement shStatement
199
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
494 hi def link shFunctionParen Delimiter
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
495 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
496
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
497 hi def link shCaseError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
498 hi def link shCondError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
499 hi def link shCurlyError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
500 hi def link shDerefError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
501 hi def link shDerefOpError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
502 hi def link shDerefWordError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
503 hi def link shDoError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
504 hi def link shEsacError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
505 hi def link shIfError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
506 hi def link shInError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
507 hi def link shParenError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
508 hi def link shTestError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
509 if exists("b:is_kornshell")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
510 hi def link shDTestError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
511 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
513 hi def link shArithmetic Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
514 hi def link shCharClass Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
515 hi def link shSnglCase Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
516 hi def link shCommandSub Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
517 hi def link shComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
518 hi def link shConditional Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
519 hi def link shExprRegion Delimiter
199
3b32f6b507fa updated for version 7.0059
vimboss
parents: 167
diff changeset
520 hi def link shFunctionKey Function
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
521 hi def link shFunctionName Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
522 hi def link shNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
523 hi def link shOperator Operator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
524 hi def link shRepeat Repeat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
525 hi def link shSet Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
526 hi def link shSetList Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
527 hi def link shShellVariables PreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
528 hi def link shSpecial Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
529 hi def link shStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
530 hi def link shString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
531 hi def link shTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
532 hi def link shAlias Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
533
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
534 " Set Current Syntax: {{{1
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
535 " ===================
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
536 if exists("b:is_bash")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
537 let b:current_syntax = "bash"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
538 elseif exists("b:is_kornshell")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
539 let b:current_syntax = "ksh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
540 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
541 let b:current_syntax = "sh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
542 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
543
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
544 " vim: ts=16 fdm=marker