annotate runtime/syntax/csh.vim @ 1785:65c332f15dbf v7.2.083

updated for version 7.2-083
author vimboss
date Tue, 13 Jan 2009 16:28:21 +0000
parents e63691e7c504
children b3bc99b909c3
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: C-shell (csh)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 507
diff changeset
4 " Version: 10
e63691e7c504 updated for version 7.1a
vimboss
parents: 507
diff changeset
5 " Last Change: Sep 11, 2006
507
a1059cda45f2 updated for version 7.0142
vimboss
parents: 7
diff changeset
6 " URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 " clusters:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 syn cluster cshQuoteList contains=cshDblQuote,cshSnglQuote,cshBckQuote
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 syn cluster cshVarList contains=cshExtVar,cshSelector,cshQtyWord,cshArgv,cshSubst
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " Variables which affect the csh itself
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn match cshSetVariables contained "argv\|histchars\|ignoreeof\|noglob\|prompt\|status"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn match cshSetVariables contained "cdpath\|history\|mail\|nonomatch\|savehist\|time"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 syn match cshSetVariables contained "cwd\|home\|noclobber\|path\|shell\|verbose"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn match cshSetVariables contained "echo"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn keyword cshTodo contained todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " Variable Name Expansion Modifiers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn match cshModifier contained ":\(h\|t\|r\|q\|x\|gh\|gt\|gr\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 " Strings and Comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn match cshNoEndlineDQ contained "[^\"]\(\\\\\)*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn match cshNoEndlineSQ contained "[^\']\(\\\\\)*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn match cshNoEndlineBQ contained "[^\`]\(\\\\\)*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 507
diff changeset
38 syn region cshDblQuote start=+[^\\]"+lc=1 skip=+\\\\\|\\"+ end=+"+ contains=cshSpecial,cshShellVariables,cshExtVar,cshSelector,cshQtyWord,cshArgv,cshSubst,cshNoEndlineDQ,cshBckQuote,@Spell
e63691e7c504 updated for version 7.1a
vimboss
parents: 507
diff changeset
39 syn region cshSnglQuote start=+[^\\]'+lc=1 skip=+\\\\\|\\'+ end=+'+ contains=cshNoEndlineSQ,@Spell
e63691e7c504 updated for version 7.1a
vimboss
parents: 507
diff changeset
40 syn region cshBckQuote start=+[^\\]`+lc=1 skip=+\\\\\|\\`+ end=+`+ contains=cshNoEndlineBQ,@Spell
e63691e7c504 updated for version 7.1a
vimboss
parents: 507
diff changeset
41 syn region cshDblQuote start=+^"+ skip=+\\\\\|\\"+ end=+"+ contains=cshSpecial,cshExtVar,cshSelector,cshQtyWord,cshArgv,cshSubst,cshNoEndlineDQ,@Spell
e63691e7c504 updated for version 7.1a
vimboss
parents: 507
diff changeset
42 syn region cshSnglQuote start=+^'+ skip=+\\\\\|\\'+ end=+'+ contains=cshNoEndlineSQ,@Spell
e63691e7c504 updated for version 7.1a
vimboss
parents: 507
diff changeset
43 syn region cshBckQuote start=+^`+ skip=+\\\\\|\\`+ end=+`+ contains=cshNoEndlineBQ,@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn cluster cshCommentGroup contains=cshTodo,@Spell
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn match cshComment "#.*$" contains=@cshCommentGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 " A bunch of useful csh keywords
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn keyword cshStatement alias end history onintr setenv unalias
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn keyword cshStatement cd eval kill popd shift unhash
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn keyword cshStatement chdir exec login pushd source
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn keyword cshStatement continue exit logout rehash time unsetenv
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn keyword cshStatement dirs glob nice repeat umask wait
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn keyword cshStatement echo goto nohup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn keyword cshConditional break case else endsw switch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn keyword cshConditional breaksw default endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syn keyword cshRepeat foreach
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 " Special environment variables
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn keyword cshShellVariables HOME LOGNAME PATH TERM USER
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 " Modifiable Variables without {}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn match cshExtVar "\$[a-zA-Z_][a-zA-Z0-9_]*\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=" contains=cshModifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn match cshSelector "\$[a-zA-Z_][a-zA-Z0-9_]*\[[a-zA-Z_]\+\]\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=" contains=cshModifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn match cshQtyWord "\$#[a-zA-Z_][a-zA-Z0-9_]*\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=" contains=cshModifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn match cshArgv "\$\d\+\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=" contains=cshModifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn match cshArgv "\$\*\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=" contains=cshModifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 " Modifiable Variables with {}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn match cshExtVar "\${[a-zA-Z_][a-zA-Z0-9_]*\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=}" contains=cshModifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 syn match cshSelector "\${[a-zA-Z_][a-zA-Z0-9_]*\[[a-zA-Z_]\+\]\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=}" contains=cshModifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn match cshQtyWord "\${#[a-zA-Z_][a-zA-Z0-9_]*\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=}" contains=cshModifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn match cshArgv "\${\d\+\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=}" contains=cshModifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 " UnModifiable Substitutions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 syn match cshSubstError "\$?[a-zA-Z_][a-zA-Z0-9_]*:\(h\|t\|r\|q\|x\|gh\|gt\|gr\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 syn match cshSubstError "\${?[a-zA-Z_][a-zA-Z0-9_]*:\(h\|t\|r\|q\|x\|gh\|gt\|gr\)}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 syn match cshSubstError "\$?[0$<]:\(h\|t\|r\|q\|x\|gh\|gt\|gr\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 syn match cshSubst "\$?[a-zA-Z_][a-zA-Z0-9_]*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 syn match cshSubst "\${?[a-zA-Z_][a-zA-Z0-9_]*}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 syn match cshSubst "\$?[0$<]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 " I/O redirection
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 syn match cshRedir ">>&!\|>&!\|>>&\|>>!\|>&\|>!\|>>\|<<\|>\|<"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 " Handle set expressions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 syn region cshSetExpr matchgroup=cshSetStmt start="\<set\>\|\<unset\>" end="$\|;" contains=cshComment,cshSetStmt,cshSetVariables,@cshQuoteList
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 " Operators and Expression-Using constructs
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 "syn match cshOperator contained "&&\|!\~\|!=\|<<\|<=\|==\|=\~\|>=\|>>\|\*\|\^\|\~\|||\|!\|\|%\|&\|+\|-\|/\|<\|>\||"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 syn match cshOperator contained "&&\|!\~\|!=\|<<\|<=\|==\|=\~\|>=\|>>\|\*\|\^\|\~\|||\|!\|%\|&\|+\|-\|/\|<\|>\||"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 syn match cshOperator contained "[(){}]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 syn region cshTest matchgroup=cshStatement start="\<if\>\|\<while\>" skip="\\$" matchgroup=cshStatement end="\<then\>\|$" contains=cshComment,cshOperator,@cshQuoteList,@cshVarLIst
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 " Highlight special characters (those which have a backslash) differently
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 syn match cshSpecial contained "\\\d\d\d\|\\[abcfnrtv\\]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 syn match cshNumber "-\=\<\d\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 " All other identifiers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 "syn match cshIdentifier "\<[a-zA-Z._][a-zA-Z0-9._]*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 " Shell Input Redirection (Here Documents)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 syn region cshHereDoc matchgroup=cshRedir start="<<-\=\s*\**END[a-zA-Z_0-9]*\**" matchgroup=cshRedir end="^END[a-zA-Z_0-9]*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 syn region cshHereDoc matchgroup=cshRedir start="<<-\=\s*\**EOF\**" matchgroup=cshRedir end="^EOF$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 syn region cshHereDoc matchgroup=cshRedir start="<<-\=\s*\**\z(\h\w*\)\**" matchgroup=cshRedir end="^\z1$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 if version >= 508 || !exists("did_csh_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 let did_csh_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 HiLink cshArgv cshVariables
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 HiLink cshBckQuote cshCommand
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 HiLink cshDblQuote cshString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 HiLink cshExtVar cshVariables
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 HiLink cshHereDoc cshString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 HiLink cshNoEndlineBQ cshNoEndline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 HiLink cshNoEndlineDQ cshNoEndline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 HiLink cshNoEndlineSQ cshNoEndline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 HiLink cshQtyWord cshVariables
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 HiLink cshRedir cshOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 HiLink cshSelector cshVariables
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 HiLink cshSetStmt cshStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 HiLink cshSetVariables cshVariables
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 HiLink cshSnglQuote cshString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 HiLink cshSubst cshVariables
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 HiLink cshCommand Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 HiLink cshComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 HiLink cshConditional Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 HiLink cshIdentifier Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 HiLink cshModifier Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 HiLink cshNoEndline Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 HiLink cshNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 HiLink cshOperator Operator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 HiLink cshRedir Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 HiLink cshRepeat Repeat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 HiLink cshShellVariables Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 HiLink cshSpecial Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 HiLink cshStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 HiLink cshString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 HiLink cshSubstError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 HiLink cshTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 HiLink cshVariables Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 let b:current_syntax = "csh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 " vim: ts=18