comparison runtime/syntax/tcsh.vim @ 1619:b9740fb41986

updated for version 7.2a
author vimboss
date Tue, 24 Jun 2008 20:39:31 +0000
parents e63691e7c504
children 7bc41231fbc7
comparison
equal deleted inserted replaced
1618:46bbe11644e0 1619:b9740fb41986
1 " Vim syntax file 1 " tcsh.vim: Vim syntax file for tcsh scripts
2 " Language: C-shell (tcsh) 2 " Maintainer: Gautam Iyer <gi1242@users.sourceforge.net>
3 " Maintainer: Gautam Iyer <gi1242@users.sourceforge.net> 3 " Modified: Sat 16 Jun 2007 04:52:12 PM PDT
4 " Last Modified: Thu 16 Nov 2006 01:07:04 PM PST
5 " 4 "
6 " Description: We break up each statement into a "command" and an "end" part. 5 " Description: We break up each statement into a "command" and an "end" part.
7 " All groups are either a "command" or part of the "end" of a statement (ie 6 " All groups are either a "command" or part of the "end" of a statement (ie
8 " everything after the "command"). This is because blindly highlighting tcsh 7 " everything after the "command"). This is because blindly highlighting tcsh
9 " statements as keywords caused way too many false positives. Eg: 8 " statements as keywords caused way too many false positives. Eg:
11 " set history=200 10 " set history=200
12 " 11 "
13 " causes history to come up as a keyword, which we want to avoid. 12 " causes history to come up as a keyword, which we want to avoid.
14 13
15 " Quit when a syntax file was already loaded 14 " Quit when a syntax file was already loaded
16 if exists("b:current_syntax") 15 if exists('b:current_syntax')
17 finish 16 finish
18 endif 17 endif
18
19 let s:oldcpo = &cpo
20 set cpo&vim " Line continuation is used
21
22 setlocal iskeyword+=-
19 23
20 syn case match 24 syn case match
21 25
22 " ----- Clusters ----- 26 " ----- Clusters -----
23 syn cluster tcshModifiers contains=tcshModifier,tcshModifierError 27 syn cluster tcshModifiers contains=tcshModifier,tcshModifierError
24 syn cluster tcshQuoteList contains=tcshDQuote,tcshSQuote,tcshBQuote 28 syn cluster tcshQuoteList contains=tcshDQuote,tcshSQuote,tcshBQuote
25 syn cluster tcshStatementEnds contains=@tcshQuoteList,tcshComment,tcshUsrVar,TcshArgv,tcshSubst,tcshRedir,tcshMeta,tcshHereDoc,tcshSpecial,tcshArguement 29 syn cluster tcshStatementEnds contains=@tcshQuoteList,tcshComment,@tcshVarList,tcshRedir,tcshMeta,tcshHereDoc,tcshSpecial,tcshArguement
26 syn cluster tcshStatements contains=tcshBuiltins,tcshCommands,tcshSet,tcshSetEnv,tcshAlias,tcshIf,tcshWhile 30 syn cluster tcshStatements contains=tcshBuiltin,tcshCommands,tcshIf,tcshWhile
27 syn cluster tcshVarList contains=tcshUsrVar,tcshArgv,tcshSubst 31 syn cluster tcshVarList contains=tcshUsrVar,tcshArgv,tcshSubst
32 syn cluster tcshConditions contains=tcshCmdSubst,tcshParenExpr,tcshOperator,tcshNumber,@tcshVarList
33
34 " ----- Errors -----
35 " Define first, so can be easily overridden.
36 syn match tcshError contained '\v\S.+'
28 37
29 " ----- Statements ----- 38 " ----- Statements -----
30 " Tcsh commands: Any filename / modifiable variable (must be first!) 39 " Tcsh commands: Any filename / modifiable variable (must be first!)
31 syn match tcshCommands '\v[a-zA-Z0-9\\./_$:-]+' contains=tcshSpecial,tcshUsrVar,tcshArgv,tcshVarError nextgroup=tcshStatementEnd 40 syn match tcshCommands '\v[a-zA-Z0-9\\./_$:-]+' contains=tcshSpecial,tcshUsrVar,tcshArgv,tcshVarError nextgroup=tcshStatementEnd
32 41
33 " Builtin commands except (un)set(env), (un)alias, if, while, else 42 " Builtin commands except those treated specially. Currently (un)set(env),
34 syn keyword tcshBuiltins nextgroup=tcshStatementEnd alloc bg bindkey break breaksw builtins bye case cd chdir complete continue default dirs echo echotc end endif endsw eval exec exit fg filetest foreach getspath getxvers glob goto hashstat history hup inlib jobs kill limit log login logout ls ls-F migrate newgrp nice nohup notify onintr popd printenv pushd rehash repeat rootnode sched setpath setspath settc setty setxvers shift source stop suspend switch telltc time umask uncomplete unhash universe unlimit ver wait warp watchlog where which 43 " (un)alias, if, while, else, bindkey
35 44 syn keyword tcshBuiltin nextgroup=tcshStatementEnd alloc bg break breaksw builtins bye case cd chdir complete continue default dirs echo echotc end endif endsw eval exec exit fg filetest foreach getspath getxvers glob goto hashstat history hup inlib jobs kill limit log login logout ls ls-F migrate newgrp nice nohup notify onintr popd printenv pushd rehash repeat rootnode sched setpath setspath settc setty setxvers shift source stop suspend switch telltc time umask uncomplete unhash universe unlimit ver wait warp watchlog where which
36 " StatementEnd is anything after a builtin / command till the lexical end of a 45
46 " StatementEnd is anything after a built-in / command till the lexical end of a
37 " statement (;, |, ||, |&, && or end of line) 47 " statement (;, |, ||, |&, && or end of line)
38 syn region tcshStatementEnd transparent contained matchgroup=tcshBuiltins start='' end='\v\\@<!(;|\|[|&]?|\&\&|$)' contains=@tcshStatementEnds 48 syn region tcshStatementEnd transparent contained matchgroup=tcshBuiltin start='' end='\v\\@<!(;|\|[|&]?|\&\&|$)' contains=@tcshStatementEnds
39 49
40 " set expressions (Contains shell variables) 50 " set expressions (Contains shell variables)
41 syn keyword tcshShellVar contained afsuser ampm argv autocorrect autoexpand autolist autologout backslash_quote catalog cdpath color colorcat command complete continue continue_args correct cwd dextract dirsfile dirstack dspmbyte dunique echo echo_style edit ellipsis fignore filec gid group histchars histdup histfile histlit history home ignoreeof implicitcd inputmode killdup killring listflags listjobs listlinks listmax listmaxrows loginsh logout mail matchbeep nobeep noclobber noding noglob nokanji nonomatch nostat notify oid owd path printexitvalue prompt prompt2 prompt3 promptchars pushdtohome pushdsilent recexact recognize_only_executables rmstar rprompt savedirs savehist sched shell shlvl status symlinks tcsh term time tperiod tty uid user verbose version visiblebell watch who wordchars 51 syn keyword tcshShellVar contained afsuser ampm argv autocorrect autoexpand autolist autologout backslash_quote catalog cdpath color colorcat command complete continue continue_args correct cwd dextract dirsfile dirstack dspmbyte dunique echo echo_style edit ellipsis fignore filec gid group histchars histdup histfile histlit history home ignoreeof implicitcd inputmode killdup killring listflags listjobs listlinks listmax listmaxrows loginsh logout mail matchbeep nobeep noclobber noding noglob nokanji nonomatch nostat notify oid owd path printexitvalue prompt prompt2 prompt3 promptchars pushdtohome pushdsilent recexact recognize_only_executables rmstar rprompt savedirs savehist sched shell shlvl status symlinks tcsh term time tperiod tty uid user verbose version visiblebell watch who wordchars
42 syn keyword tcshSet nextgroup=tcshSetEnd set unset 52 syn keyword tcshBuiltin nextgroup=tcshSetEnd set unset
43 syn region tcshSetEnd contained transparent matchgroup=tcshBuiltins start='' skip="\\$" end="$\|;" contains=tcshShellVar,@tcshStatementEnds 53 syn region tcshSetEnd contained transparent matchgroup=tcshBuiltin start='' skip='\\$' end='$\|;' contains=tcshShellVar,@tcshStatementEnds
44 54
45 " setenv expressions (Contains enviorenment variables) 55 " setenv expressions (Contains environment variables)
46 syn keyword tcshEnvVar contained AFSUSER COLUMNS DISPLAY EDITOR GROUP HOME HOST HOSTTYPE HPATH LANG LC_CTYPE LINES LS_COLORS MACHTYPE NOREBIND OSTYPE PATH PWD REMOTEHOST SHLVL SYSTYPE TERM TERMCAP USER VENDOR VISUAL 56 syn keyword tcshEnvVar contained AFSUSER COLUMNS DISPLAY EDITOR GROUP HOME HOST HOSTTYPE HPATH LANG LC_CTYPE LINES LS_COLORS MACHTYPE NOREBIND OSTYPE PATH PWD REMOTEHOST SHLVL SYSTYPE TERM TERMCAP USER VENDOR VISUAL
47 syn keyword tcshSetEnv nextgroup=tcshEnvEnd setenv unsetenv 57 syn keyword tcshBuiltin nextgroup=tcshEnvEnd setenv unsetenv
48 syn region tcshEnvEnd contained transparent matchgroup=tcshBuiltins start='' skip="\\$" end="$\|;" contains=tcshEnvVar,@tcshStatementEnds 58 syn region tcshEnvEnd contained transparent matchgroup=tcshBuiltin start='' skip='\\$' end='$\|;' contains=tcshEnvVar,@tcshStatementEnds
49 59
50 " alias and unalias (contains special aliases) 60 " alias and unalias (contains special aliases)
51 syn keyword tcshAliases contained beepcmd cwdcmd jobcmd helpcommand periodic precmd postcmd shell 61 syn keyword tcshAliases contained beepcmd cwdcmd jobcmd helpcommand periodic precmd postcmd shell
52 syn keyword tcshAlias nextgroup=tcshAliCmd skipwhite alias unalias 62 syn keyword tcshBuiltin nextgroup=tcshAliCmd skipwhite alias unalias
53 syn match tcshAliCmd contained nextgroup=tcshAliEnd skipwhite '\v[\w-]+' contains=tcshAliases 63 syn match tcshAliCmd contained nextgroup=tcshAliEnd skipwhite '\v[\w-]+' contains=tcshAliases
54 syn region tcshAliEnd contained transparent matchgroup=tcshBuiltins start='' skip="\\$" end="$\|;" contains=@tcshStatementEnds 64 syn region tcshAliEnd contained transparent matchgroup=tcshBuiltin start='' skip='\\$' end='$\|;' contains=@tcshStatementEnds
55 65
56 " if statements (contains expressions / operators) 66 " if statements
57 syn keyword tcshIf nextgroup=tcshIfEnd if 67 syn keyword tcshIf nextgroup=tcshIfEnd skipwhite if
58 syn region tcshIfEnd contained matchgroup=tcshBuiltins start='' skip="\\$" end="\v<then>|$" contains=tcshOperator,tcshNumber,@tcshStatementEnds 68 syn region tcshIfEnd contained start='\S' skip='\\$' matchgroup=tcshBuiltin end='\v<then>|$' contains=@tcshConditions,tcshSpecial,@tcshStatementEnds
59 69 syn region tcshIfEnd contained matchgroup=tcshBuiltin contains=@tcshConditions,tcshSpecial start='(' end='\v\)%(\s+then>)?' skipwhite nextgroup=@tcshStatementEnds
60 " else statements (nextgroup if) 70 syn region tcshIfEnd contained matchgroup=tcshBuiltin contains=tcshCommands,tcshSpecial start='\v\{\s+' end='\v\s+\}%(\s+then>)?' skipwhite nextgroup=@tcshStatementEnds keepend
61 syn keyword tcshElse nextgroup=tcshIf skipwhite else 71
72 " else statements
73 syn keyword tcshBuiltin nextgroup=tcshIf skipwhite else
62 74
63 " while statements (contains expressions / operators) 75 " while statements (contains expressions / operators)
64 syn keyword tcshWhile nextgroup=tcshWhEnd while 76 syn keyword tcshBuiltin nextgroup=@tcshConditions,tcshSpecial skipwhite while
65 syn region tcshWhEnd contained transparent matchgroup=tcshBuiltins start='' skip="\\$" end="\v$" contains=tcshOperator,tcshNumber,@tcshStatementEnds 77
78 " Conditions (for if and while)
79 syn region tcshParenExpr contained contains=@tcshConditions,tcshSpecial matchgroup=tcshBuiltin start='(' end=')'
80 syn region tcshCmdSubst contained contains=tcshCommands matchgroup=tcshBuiltin start='\v\{\s+' end='\v\s+\}' keepend
81
82 " Bindkey. Internal editor functions
83 syn keyword tcshBindkeyFuncs contained backward-char backward-delete-char
84 \ backward-delete-word backward-kill-line backward-word
85 \ beginning-of-line capitalize-word change-case
86 \ change-till-end-of-line clear-screen complete-word
87 \ complete-word-fwd complete-word-back complete-word-raw
88 \ copy-prev-word copy-region-as-kill dabbrev-expand delete-char
89 \ delete-char-or-eof delete-char-or-list
90 \ delete-char-or-list-or-eof delete-word digit digit-argument
91 \ down-history downcase-word end-of-file end-of-line
92 \ exchange-point-and-mark expand-glob expand-history expand-line
93 \ expand-variables forward-char forward-word
94 \ gosmacs-transpose-chars history-search-backward
95 \ history-search-forward insert-last-word i-search-fwd
96 \ i-search-back keyboard-quit kill-line kill-region
97 \ kill-whole-line list-choices list-choices-raw list-glob
98 \ list-or-eof load-average magic-space newline normalize-path
99 \ normalize-command overwrite-mode prefix-meta quoted-insert
100 \ redisplay run-fg-editor run-help self-insert-command
101 \ sequence-lead-in set-mark-command spell-word spell-line
102 \ stuff-char toggle-literal-history transpose-chars
103 \ transpose-gosling tty-dsusp tty-flush-output tty-sigintr
104 \ tty-sigquit tty-sigtsusp tty-start-output tty-stop-output
105 \ undefined-key universal-argument up-history upcase-word
106 \ vi-beginning-of-next-word vi-add vi-add-at-eol vi-chg-case
107 \ vi-chg-meta vi-chg-to-eol vi-cmd-mode vi-cmd-mode-complete
108 \ vi-delprev vi-delmeta vi-endword vi-eword vi-char-back
109 \ vi-char-fwd vi-charto-back vi-charto-fwd vi-insert
110 \ vi-insert-at-bol vi-repeat-char-fwd vi-repeat-char-back
111 \ vi-repeat-search-fwd vi-repeat-search-back vi-replace-char
112 \ vi-replace-mode vi-search-back vi-search-fwd vi-substitute-char
113 \ vi-substitute-line vi-word-back vi-word-fwd vi-undo vi-zero
114 \ which-command yank yank-pop e_copy_to_clipboard
115 \ e_paste_from_clipboard e_dosify_next e_dosify_prev e_page_up
116 \ e_page_down
117 syn keyword tcshBuiltin nextgroup=tcshBindkeyEnd bindkey
118 syn region tcshBindkeyEnd contained transparent matchgroup=tcshBuiltin start='' skip='\\$' end='$' contains=@tcshQuoteList,tcshComment,@tcshVarList,tcshMeta,tcshSpecial,tcshArguement,tcshBindkeyFuncs
66 119
67 " Expressions start with @. 120 " Expressions start with @.
68 syn match tcshExprStart "\v\@\s+" nextgroup=tcshExprVar 121 syn match tcshExprStart '\v\@\s+' nextgroup=tcshExprVar
69 syn match tcshExprVar contained "\v\h\w*%(\[\d+\])?" contains=tcshShellVar,tcshEnvVar nextgroup=tcshExprOp 122 syn match tcshExprVar contained '\v\h\w*%(\[\d+\])?' contains=tcshShellVar,tcshEnvVar nextgroup=tcshExprOp
70 syn match tcshExprOp contained "++\|--" 123 syn match tcshExprOp contained '++\|--'
71 syn match tcshExprOp contained "\v\s*\=" nextgroup=tcshExprEnd 124 syn match tcshExprOp contained '\v\s*\=' nextgroup=tcshExprEnd
72 syn match tcshExprEnd contained "\v.*$"hs=e+1 contains=tcshOperator,tcshNumber,@tcshVarList 125 syn match tcshExprEnd contained '\v.*$'hs=e+1 contains=@tcshConditions
73 syn match tcshExprEnd contained "\v.{-};"hs=e contains=tcshOperator,tcshNumber,@tcshVarList 126 syn match tcshExprEnd contained '\v.{-};'hs=e contains=@tcshConditions
74 127
75 " ----- Comments: ----- 128 " ----- Comments: -----
76 syn match tcshComment '#\s.*' contains=tcshTodo,tcshCommentTi,@Spell 129 syn match tcshComment '#\s.*' contains=tcshTodo,tcshCommentTi,@Spell
77 syn match tcshComment '\v#($|\S.*)' contains=tcshTodo,tcshCommentTi 130 syn match tcshComment '\v#($|\S.*)' contains=tcshTodo,tcshCommentTi
78 syn match tcshSharpBang '^#! .*$' 131 syn match tcshSharpBang '^#! .*$'
83 " Tcsh does not allow \" in strings unless the "backslash_quote" shell 136 " Tcsh does not allow \" in strings unless the "backslash_quote" shell
84 " variable is set. Set the vim variable "tcsh_backslash_quote" to 0 if you 137 " variable is set. Set the vim variable "tcsh_backslash_quote" to 0 if you
85 " want VIM to assume that no backslash quote constructs exist. 138 " want VIM to assume that no backslash quote constructs exist.
86 139
87 " Backquotes are treated as commands, and are not contained in anything 140 " Backquotes are treated as commands, and are not contained in anything
88 if(exists("tcsh_backslash_quote") && tcsh_backslash_quote == 0) 141 if(exists('tcsh_backslash_quote') && tcsh_backslash_quote == 0)
89 syn region tcshSQuote keepend contained start="\v\\@<!'" end="'" contains=@Spell 142 syn region tcshSQuote keepend contained start="\v\\@<!'" end="'"
90 syn region tcshDQuote keepend contained start='\v\\@<!"' end='"' contains=@tcshVarList,tcshSpecial,@Spell 143 syn region tcshDQuote keepend contained start='\v\\@<!"' end='"' contains=@tcshVarList,tcshSpecial,@Spell
91 syn region tcshBQuote keepend start='\v\\@<!`' end='`' contains=@tcshStatements 144 syn region tcshBQuote keepend start='\v\\@<!`' end='`' contains=@tcshStatements
92 else 145 else
93 syn region tcshSQuote contained start="\v\\@<!'" skip="\v\\\\|\\'" end="'" contains=@Spell 146 syn region tcshSQuote contained start="\v\\@<!'" skip="\v\\\\|\\'" end="'"
94 syn region tcshDQuote contained start='\v\\@<!"' end='"' contains=@tcshVarList,tcshSpecial,@Spell 147 syn region tcshDQuote contained start='\v\\@<!"' end='"' contains=@tcshVarList,tcshSpecial,@Spell
95 syn region tcshBQuote keepend matchgroup=tcshBQuoteGrp start='\v\\@<!`' skip='\v\\\\|\\`' end='`' contains=@tcshStatements 148 syn region tcshBQuote keepend matchgroup=tcshBQuoteGrp start='\v\\@<!`' skip='\v\\\\|\\`' end='`' contains=@tcshStatements
96 endif 149 endif
97 150
98 " ----- Variables ----- 151 " ----- Variables -----
99 " Variable Errors. Must come first! \$ constructs will be flagged by 152 " Variable Errors. Must come first! \$ constructs will be flagged by
100 " tcshSpecial, so we don't consider them here. 153 " tcshSpecial, so we don't consider them here.
101 syn match tcshVarError '\v\$\S*' contained 154 syn match tcshVarError '\v\$\S*' contained
102 155
103 " Modifiable Variables without {}. 156 " Modifiable Variables without {}.
104 syn match tcshUsrVar contained "\v\$\h\w*%(\[\d+%(-\d+)?\])?" nextgroup=@tcshModifiers contains=tcshShellVar,tcshEnvVar 157 syn match tcshUsrVar contained '\v\$\h\w*%(\[\d+%(-\d+)?\])?' nextgroup=@tcshModifiers contains=tcshShellVar,tcshEnvVar
105 syn match tcshArgv contained "\v\$%(\d+|\*)" nextgroup=@tcshModifiers 158 syn match tcshArgv contained '\v\$%(\d+|\*)' nextgroup=@tcshModifiers
106 159
107 " Modifiable Variables with {}. 160 " Modifiable Variables with {}.
108 syn match tcshUsrVar contained "\v\$\{\h\w*%(\[\d+%(-\d+)?\])?%(:\S*)?\}" contains=@tcshModifiers,tcshShellVar,tcshEnvVar 161 syn match tcshUsrVar contained '\v\$\{\h\w*%(\[\d+%(-\d+)?\])?%(:\S*)?\}' contains=@tcshModifiers,tcshShellVar,tcshEnvVar
109 syn match tcshArgv contained "\v\$\{%(\d+|\*)%(:\S*)?\}" contains=@tcshModifiers 162 syn match tcshArgv contained '\v\$\{%(\d+|\*)%(:\S*)?\}' contains=@tcshModifiers
110 163
111 " UnModifiable Substitutions. Order is important here. 164 " Un-modifiable Substitutions. Order is important here.
112 syn match tcshSubst contained "\v\$[?#$!_<]" nextgroup=tcshModifierError 165 syn match tcshSubst contained '\v\$[?#$!_<]' nextgroup=tcshModifierError
113 syn match tcshSubst contained "\v\$[%#?]%(\h\w*|\d+)" nextgroup=tcshModifierError contains=tcshShellVar,tcshEnvVar 166 syn match tcshSubst contained '\v\$[%#?]%(\h\w*|\d+)' nextgroup=tcshModifierError contains=tcshShellVar,tcshEnvVar
114 syn match tcshSubst contained "\v\$\{[%#?]%(\h\w*|\d+)%(:\S*)?\}" contains=tcshModifierError contains=tcshShellVar,tcshEnvVar 167 syn match tcshSubst contained '\v\$\{[%#?]%(\h\w*|\d+)%(:\S*)?\}' contains=tcshModifierError contains=tcshShellVar,tcshEnvVar
115 168
116 " Variable Name Expansion Modifiers (order important) 169 " Variable Name Expansion Modifiers (order important)
117 syn match tcshModifierError contained '\v:\S*' 170 syn match tcshModifierError contained '\v:\S*'
118 syn match tcshModifier contained '\v:[ag]?[htreuls&qx]' nextgroup=@tcshModifiers 171 syn match tcshModifier contained '\v:[ag]?[htreuls&qx]' nextgroup=@tcshModifiers
119 172
120 " ----- Operators / Specials ----- 173 " ----- Operators / Specials -----
121 " Standard redirects (except <<) [<, >, >>, >>&, >>!, >>&!] 174 " Standard redirects (except <<) [<, >, >>, >>&, >>!, >>&!]
122 syn match tcshRedir contained "\v\<|\>\>?\&?!?" 175 syn match tcshRedir contained '\v\<|\>\>?\&?!?'
123 176
124 " Metachars 177 " Meta-chars
125 syn match tcshMeta contained "\v[]{}*?[]" 178 syn match tcshMeta contained '\v[]{}*?[]'
126 179
127 " Here Documents (<<) 180 " Here documents (<<)
128 syn region tcshHereDoc contained matchgroup=tcshRedir start="\v\<\<\s*\z(\h\w*)" end="^\z1$" contains=@tcshVarList,tcshSpecial 181 syn region tcshHereDoc contained matchgroup=tcshShellVar start='\v\<\<\s*\z(\h\w*)' end='^\z1$' contains=@tcshVarList,tcshSpecial
129 syn region tcshHereDoc contained matchgroup=tcshRedir start="\v\<\<\s*'\z(\h\w*)'" start='\v\<\<\s*"\z(\h\w*)"$' start="\v\<\<\s*\\\z(\h\w*)$" end="^\z1$" 182 syn region tcshHereDoc contained matchgroup=tcshShellVar start="\v\<\<\s*'\z(\h\w*)'" start='\v\<\<\s*"\z(\h\w*)"$' start='\v\<\<\s*\\\z(\h\w*)$' end='^\z1$'
130 183
131 " Operators 184 " Operators
132 syn match tcshOperator contained "&&\|!\~\|!=\|<<\|<=\|==\|=\~\|>=\|>>\|\*\|\^\|\~\|||\|!\|%\|&\|+\|-\|/\|<\|>\||" 185 syn match tcshOperator contained '&&\|!\~\|!=\|<<\|<=\|==\|=\~\|>=\|>>\|\*\|\^\|\~\|||\|!\|%\|&\|+\|-\|/\|<\|>\||'
133 syn match tcshOperator contained "[(){}]" 186 "syn match tcshOperator contained '[(){}]'
134 187
135 " Numbers 188 " Numbers
136 syn match tcshNumber contained "\v<-?\d+>" 189 syn match tcshNumber contained '\v<-?\d+>'
137 190
138 " Arguements 191 " Arguments
139 syn match tcshArguement contained "\v\s@<=-(\w|-)*" 192 syn match tcshArguement contained '\v\s@<=-(\w|-)*'
140 193
141 " Special charectors 194 " Special characters. \xxx, or backslashed characters.
142 syn match tcshSpecial contained "\v\\@<!\\(\d{3}|.)" 195 "syn match tcshSpecial contained '\v\\@<!\\(\d{3}|.)'
143 196 syn match tcshSpecial contained '\v\\%([0-7]{3}|.)'
144 " ----- Syncronising ----- 197
145 if exists("tcsh_minlines") 198 " ----- Synchronising -----
146 exec "syn sync minlines=" . tcsh_minlines 199 if exists('tcsh_minlines')
200 exec 'syn sync minlines=' . tcsh_minlines
147 else 201 else
148 syn sync minlines=15 " Except 'here' documents, nothing is long 202 syn sync minlines=100 " Some completions can be quite long
149 endif 203 endif
150 204
151 " Define highlighting of syntax groups 205 " Define highlighting of syntax groups
152 hi def link tcshBuiltins statement 206 hi def link tcshError Error
153 hi def link tcshShellVar preproc 207 hi def link tcshBuiltin Statement
208 hi def link tcshShellVar Preproc
154 hi def link tcshEnvVar tcshShellVar 209 hi def link tcshEnvVar tcshShellVar
155 hi def link tcshAliases tcshShellVar 210 hi def link tcshAliases tcshShellVar
156 hi def link tcshAliCmd identifier 211 hi def link tcshAliCmd Identifier
157 hi def link tcshCommands identifier 212 hi def link tcshCommands Identifier
158 hi def link tcshSet tcshBuiltins 213 hi def link tcshIf tcshBuiltin
159 hi def link tcshSetEnv tcshBuiltins 214 hi def link tcshWhile tcshBuiltin
160 hi def link tcshAlias tcshBuiltins 215 hi def link tcshBindkeyFuncs Function
161 hi def link tcshIf tcshBuiltins 216 hi def link tcshExprStart tcshBuiltin
162 hi def link tcshElse tcshBuiltins
163 hi def link tcshWhile tcshBuiltins
164 hi def link tcshExprStart tcshBuiltins
165 hi def link tcshExprVar tcshUsrVar 217 hi def link tcshExprVar tcshUsrVar
166 hi def link tcshExprOp tcshOperator 218 hi def link tcshExprOp tcshOperator
167 hi def link tcshExprEnd tcshOperator 219 hi def link tcshExprEnd tcshOperator
168 hi def link tcshComment comment 220 hi def link tcshComment Comment
169 hi def link tcshCommentTi preproc 221 hi def link tcshCommentTi Preproc
170 hi def link tcshSharpBang tcshCommentTi 222 hi def link tcshSharpBang tcshCommentTi
171 hi def link tcshTodo todo 223 hi def link tcshTodo Todo
172 hi def link tcshSQuote constant 224 hi def link tcshSQuote Constant
173 hi def link tcshDQuote tcshSQuote 225 hi def link tcshDQuote tcshSQuote
174 hi def link tcshBQuoteGrp include 226 hi def link tcshBQuoteGrp Include
175 hi def link tcshVarError error 227 hi def link tcshVarError Error
176 hi def link tcshUsrVar type 228 hi def link tcshUsrVar Type
177 hi def link tcshArgv tcshUsrVar 229 hi def link tcshArgv tcshUsrVar
178 hi def link tcshSubst tcshUsrVar 230 hi def link tcshSubst tcshUsrVar
179 hi def link tcshModifier tcshArguement 231 hi def link tcshModifier tcshArguement
180 hi def link tcshModifierError tcshVarError 232 hi def link tcshModifierError tcshVarError
181 hi def link tcshMeta tcshSubst 233 hi def link tcshMeta tcshSubst
182 hi def link tcshRedir tcshOperator 234 hi def link tcshRedir tcshOperator
183 hi def link tcshHereDoc tcshSQuote 235 hi def link tcshHereDoc tcshSQuote
184 hi def link tcshOperator operator 236 hi def link tcshOperator Operator
185 hi def link tcshNumber number 237 hi def link tcshNumber Number
186 hi def link tcshArguement special 238 hi def link tcshArguement Special
187 hi def link tcshSpecial specialchar 239 hi def link tcshSpecial SpecialChar
188 240
189 let b:current_syntax = "tcsh" 241 let &cpo = s:oldcpo
242 unlet s:oldcpo
243
244 let b:current_syntax = 'tcsh'