Mercurial > vim
annotate runtime/syntax/csh.vim @ 10048:43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 30 23:26:57 2016 +0200
Updated runtime files. Remove version checks for Vim older than 6.0.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 30 Aug 2016 23:30:09 +0200 |
parents | dff4e29c6905 |
children | 46763b01cd9a |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: C-shell (csh) | |
6479 | 3 " Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz> |
6744 | 4 " Last Change: Oct 23, 2014 |
6479 | 5 " Version: 11 |
6 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_CSH | |
7 | 7 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
8 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
9 if exists("b:current_syntax") |
7 | 10 finish |
11 endif | |
12 | |
13 " clusters: | |
14 syn cluster cshQuoteList contains=cshDblQuote,cshSnglQuote,cshBckQuote | |
15 syn cluster cshVarList contains=cshExtVar,cshSelector,cshQtyWord,cshArgv,cshSubst | |
16 | |
17 " Variables which affect the csh itself | |
18 syn match cshSetVariables contained "argv\|histchars\|ignoreeof\|noglob\|prompt\|status" | |
19 syn match cshSetVariables contained "cdpath\|history\|mail\|nonomatch\|savehist\|time" | |
20 syn match cshSetVariables contained "cwd\|home\|noclobber\|path\|shell\|verbose" | |
21 syn match cshSetVariables contained "echo" | |
22 | |
23 syn case ignore | |
24 syn keyword cshTodo contained todo | |
25 syn case match | |
26 | |
27 " Variable Name Expansion Modifiers | |
28 syn match cshModifier contained ":\(h\|t\|r\|q\|x\|gh\|gt\|gr\)" | |
29 | |
30 " Strings and Comments | |
31 syn match cshNoEndlineDQ contained "[^\"]\(\\\\\)*$" | |
32 syn match cshNoEndlineSQ contained "[^\']\(\\\\\)*$" | |
33 syn match cshNoEndlineBQ contained "[^\`]\(\\\\\)*$" | |
34 | |
1121 | 35 syn region cshDblQuote start=+[^\\]"+lc=1 skip=+\\\\\|\\"+ end=+"+ contains=cshSpecial,cshShellVariables,cshExtVar,cshSelector,cshQtyWord,cshArgv,cshSubst,cshNoEndlineDQ,cshBckQuote,@Spell |
36 syn region cshSnglQuote start=+[^\\]'+lc=1 skip=+\\\\\|\\'+ end=+'+ contains=cshNoEndlineSQ,@Spell | |
37 syn region cshBckQuote start=+[^\\]`+lc=1 skip=+\\\\\|\\`+ end=+`+ contains=cshNoEndlineBQ,@Spell | |
38 syn region cshDblQuote start=+^"+ skip=+\\\\\|\\"+ end=+"+ contains=cshSpecial,cshExtVar,cshSelector,cshQtyWord,cshArgv,cshSubst,cshNoEndlineDQ,@Spell | |
39 syn region cshSnglQuote start=+^'+ skip=+\\\\\|\\'+ end=+'+ contains=cshNoEndlineSQ,@Spell | |
40 syn region cshBckQuote start=+^`+ skip=+\\\\\|\\`+ end=+`+ contains=cshNoEndlineBQ,@Spell | |
7 | 41 syn cluster cshCommentGroup contains=cshTodo,@Spell |
42 syn match cshComment "#.*$" contains=@cshCommentGroup | |
43 | |
44 " A bunch of useful csh keywords | |
45 syn keyword cshStatement alias end history onintr setenv unalias | |
46 syn keyword cshStatement cd eval kill popd shift unhash | |
47 syn keyword cshStatement chdir exec login pushd source | |
48 syn keyword cshStatement continue exit logout rehash time unsetenv | |
49 syn keyword cshStatement dirs glob nice repeat umask wait | |
50 syn keyword cshStatement echo goto nohup | |
51 | |
52 syn keyword cshConditional break case else endsw switch | |
53 syn keyword cshConditional breaksw default endif | |
54 syn keyword cshRepeat foreach | |
55 | |
56 " Special environment variables | |
57 syn keyword cshShellVariables HOME LOGNAME PATH TERM USER | |
58 | |
59 " Modifiable Variables without {} | |
60 syn match cshExtVar "\$[a-zA-Z_][a-zA-Z0-9_]*\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=" contains=cshModifier | |
61 syn match cshSelector "\$[a-zA-Z_][a-zA-Z0-9_]*\[[a-zA-Z_]\+\]\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=" contains=cshModifier | |
62 syn match cshQtyWord "\$#[a-zA-Z_][a-zA-Z0-9_]*\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=" contains=cshModifier | |
63 syn match cshArgv "\$\d\+\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=" contains=cshModifier | |
64 syn match cshArgv "\$\*\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=" contains=cshModifier | |
65 | |
66 " Modifiable Variables with {} | |
67 syn match cshExtVar "\${[a-zA-Z_][a-zA-Z0-9_]*\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=}" contains=cshModifier | |
68 syn match cshSelector "\${[a-zA-Z_][a-zA-Z0-9_]*\[[a-zA-Z_]\+\]\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=}" contains=cshModifier | |
69 syn match cshQtyWord "\${#[a-zA-Z_][a-zA-Z0-9_]*\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=}" contains=cshModifier | |
70 syn match cshArgv "\${\d\+\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=}" contains=cshModifier | |
71 | |
72 " UnModifiable Substitutions | |
73 syn match cshSubstError "\$?[a-zA-Z_][a-zA-Z0-9_]*:\(h\|t\|r\|q\|x\|gh\|gt\|gr\)" | |
74 syn match cshSubstError "\${?[a-zA-Z_][a-zA-Z0-9_]*:\(h\|t\|r\|q\|x\|gh\|gt\|gr\)}" | |
75 syn match cshSubstError "\$?[0$<]:\(h\|t\|r\|q\|x\|gh\|gt\|gr\)" | |
76 syn match cshSubst "\$?[a-zA-Z_][a-zA-Z0-9_]*" | |
77 syn match cshSubst "\${?[a-zA-Z_][a-zA-Z0-9_]*}" | |
78 syn match cshSubst "\$?[0$<]" | |
79 | |
80 " I/O redirection | |
81 syn match cshRedir ">>&!\|>&!\|>>&\|>>!\|>&\|>!\|>>\|<<\|>\|<" | |
82 | |
83 " Handle set expressions | |
84 syn region cshSetExpr matchgroup=cshSetStmt start="\<set\>\|\<unset\>" end="$\|;" contains=cshComment,cshSetStmt,cshSetVariables,@cshQuoteList | |
85 | |
86 " Operators and Expression-Using constructs | |
87 "syn match cshOperator contained "&&\|!\~\|!=\|<<\|<=\|==\|=\~\|>=\|>>\|\*\|\^\|\~\|||\|!\|\|%\|&\|+\|-\|/\|<\|>\||" | |
88 syn match cshOperator contained "&&\|!\~\|!=\|<<\|<=\|==\|=\~\|>=\|>>\|\*\|\^\|\~\|||\|!\|%\|&\|+\|-\|/\|<\|>\||" | |
89 syn match cshOperator contained "[(){}]" | |
90 syn region cshTest matchgroup=cshStatement start="\<if\>\|\<while\>" skip="\\$" matchgroup=cshStatement end="\<then\>\|$" contains=cshComment,cshOperator,@cshQuoteList,@cshVarLIst | |
91 | |
92 " Highlight special characters (those which have a backslash) differently | |
93 syn match cshSpecial contained "\\\d\d\d\|\\[abcfnrtv\\]" | |
94 syn match cshNumber "-\=\<\d\+\>" | |
95 | |
96 " All other identifiers | |
97 "syn match cshIdentifier "\<[a-zA-Z._][a-zA-Z0-9._]*\>" | |
98 | |
99 " Shell Input Redirection (Here Documents) | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
100 syn region cshHereDoc matchgroup=cshRedir start="<<-\=\s*\**\z(\h\w*\)\**" matchgroup=cshRedir end="^\z1$" |
7 | 101 |
102 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
103 " Only when an item doesn't have highlighting yet |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
104 command -nargs=+ HiLink hi def link <args> |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
105 |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
106 HiLink cshArgv cshVariables |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
107 HiLink cshBckQuote cshCommand |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
108 HiLink cshDblQuote cshString |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
109 HiLink cshExtVar cshVariables |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
110 HiLink cshHereDoc cshString |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
111 HiLink cshNoEndlineBQ cshNoEndline |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
112 HiLink cshNoEndlineDQ cshNoEndline |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
113 HiLink cshNoEndlineSQ cshNoEndline |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
114 HiLink cshQtyWord cshVariables |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
115 HiLink cshRedir cshOperator |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
116 HiLink cshSelector cshVariables |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
117 HiLink cshSetStmt cshStatement |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
118 HiLink cshSetVariables cshVariables |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
119 HiLink cshSnglQuote cshString |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
120 HiLink cshSubst cshVariables |
7 | 121 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
122 HiLink cshCommand Statement |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
123 HiLink cshComment Comment |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
124 HiLink cshConditional Conditional |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
125 HiLink cshIdentifier Error |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
126 HiLink cshModifier Special |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
127 HiLink cshNoEndline Error |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
128 HiLink cshNumber Number |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
129 HiLink cshOperator Operator |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
130 HiLink cshRedir Statement |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
131 HiLink cshRepeat Repeat |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
132 HiLink cshShellVariables Special |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
133 HiLink cshSpecial Special |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
134 HiLink cshStatement Statement |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
135 HiLink cshString String |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
136 HiLink cshSubstError Error |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
137 HiLink cshTodo Todo |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
138 HiLink cshVariables Type |
7 | 139 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
140 delcommand HiLink |
7 | 141 |
142 let b:current_syntax = "csh" | |
143 | |
144 " vim: ts=18 |