Mercurial > vim
annotate runtime/syntax/csh.vim @ 27337:65bdfff0b00a
Added tag v8.2.4196 for changeset 9ef98290c41ae19ae8fdd41c5990198d8c25dc51
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 23 Jan 2022 18:15:04 +0100 |
parents | 8edf0aeb71b9 |
children | 02bd0fe77c68 |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: C-shell (csh) | |
19180 | 3 " Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM> |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
4 " Last Change: Aug 31, 2016 |
19180 | 5 " Version: 14 |
6479 | 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. | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
103 if !exists("skip_csh_syntax_inits") |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
104 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
105 hi def link cshArgv cshVariables |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
106 hi def link cshBckQuote cshCommand |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
107 hi def link cshDblQuote cshString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
108 hi def link cshExtVar cshVariables |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
109 hi def link cshHereDoc cshString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
110 hi def link cshNoEndlineBQ cshNoEndline |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
111 hi def link cshNoEndlineDQ cshNoEndline |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
112 hi def link cshNoEndlineSQ cshNoEndline |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
113 hi def link cshQtyWord cshVariables |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
114 hi def link cshRedir cshOperator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
115 hi def link cshSelector cshVariables |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
116 hi def link cshSetStmt cshStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
117 hi def link cshSetVariables cshVariables |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
118 hi def link cshSnglQuote cshString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
119 hi def link cshSubst cshVariables |
7 | 120 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
121 hi def link cshCommand Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
122 hi def link cshComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
123 hi def link cshConditional Conditional |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
124 hi def link cshIdentifier Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
125 hi def link cshModifier Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
126 hi def link cshNoEndline Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
127 hi def link cshNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
128 hi def link cshOperator Operator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
129 hi def link cshRedir Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
130 hi def link cshRepeat Repeat |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
131 hi def link cshShellVariables Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
132 hi def link cshSpecial Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
133 hi def link cshStatement Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
134 hi def link cshString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
135 hi def link cshSubstError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
136 hi def link cshTodo Todo |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
137 hi def link cshVariables Type |
7 | 138 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
139 endif |
7 | 140 |
141 let b:current_syntax = "csh" | |
142 | |
143 " vim: ts=18 |