2 " Language: Century Term Command Script
3 " Maintainer: Sean M. McKee <mckee@misslink.net>
4 " Last Change: 2001 May 09
5 " Version Info: @(#)cterm.vim 1.7 97/12/15 09:23:14
7 " For version 5.x: Clear all syntax items
8 " For version 6.x: Quit when a syntax file was already loaded
11 elseif exists("b:current_syntax")
18 syn keyword ctermFunction abort addcr addlf answer at attr batch baud
19 syn keyword ctermFunction break call capture cd cdelay charset cls color
20 syn keyword ctermFunction combase config commect copy cread
21 syn keyword ctermFunction creadint devprefix dialer dialog dimint
22 syn keyword ctermFunction dimlog dimstr display dtimeout dwait edit
23 syn keyword ctermFunction editor emulate erase escloop fcreate
24 syn keyword ctermFunction fflush fillchar flags flush fopen fread
25 syn keyword ctermFunction freadln fseek fwrite fwriteln get hangup
26 syn keyword ctermFunction help hiwait htime ignore init itime
27 syn keyword ctermFunction keyboard lchar ldelay learn lockfile
28 syn keyword ctermFunction locktime log login logout lowait
29 syn keyword ctermFunction lsend ltime memlist menu mkdir mode
30 syn keyword ctermFunction modem netdialog netport noerror pages parity
31 syn keyword ctermFunction pause portlist printer protocol quit rcv
32 syn keyword ctermFunction read readint readn redial release
33 syn keyword ctermFunction remote rename restart retries return
34 syn keyword ctermFunction rmdir rtime run runx scrollback send
35 syn keyword ctermFunction session set setcap setcolor setkey
36 syn keyword ctermFunction setsym setvar startserver status
37 syn keyword ctermFunction stime stopbits stopserver tdelay
38 syn keyword ctermFunction terminal time trans type usend version
39 syn keyword ctermFunction vi vidblink vidcard vidout vidunder wait
40 syn keyword ctermFunction wildsize wclose wopen wordlen wru wruchar
41 syn keyword ctermFunction xfer xmit xprot
42 syn match ctermFunction "\?"
43 "syn keyword ctermFunction comment remark
47 syn keyword ctermIntFunction asc atod eval filedate filemode filesize ftell
48 syn keyword ctermIntFunction len termbits opsys pos sum time val mdmstat
49 "END INTEGER FUNCTIONS
52 syn keyword ctermStrFunction cdate ctime chr chrdy chrin comin getenv
53 syn keyword ctermStrFunction gethomedir left midstr right str tolower
54 syn keyword ctermStrFunction toupper uniq comst exists feof hascolor
58 "PREDEFINED TERM VARIABLES R/W
59 syn keyword ctermPreVarRW f _escloop _filename _kermiteol _obufsiz
60 syn keyword ctermPreVarRW _port _rcvsync _cbaud _reval _turnchar
61 syn keyword ctermPreVarRW _txblksiz _txwindow _vmin _vtime _cparity
62 syn keyword ctermPreVarRW _cnumber false t true _cwordlen _cstopbits
63 syn keyword ctermPreVarRW _cmode _cemulate _cxprot _clogin _clogout
64 syn keyword ctermPreVarRW _cstartsrv _cstopsrv _ccmdfile _cwru
65 syn keyword ctermPreVarRW _cprotocol _captfile _cremark _combufsiz
66 syn keyword ctermPreVarRW logfile
67 "END PREDEFINED TERM VARIABLES R/W
69 "PREDEFINED TERM VARIABLES R/O
70 syn keyword ctermPreVarRO _1 _2 _3 _4 _5 _6 _7 _8 _9 _cursess
71 syn keyword ctermPreVarRO _lockfile _baud _errno _retval _sernum
72 syn keyword ctermPreVarRO _timeout _row _col _version
73 "END PREDEFINED TERM VARIABLES R/O
75 syn keyword ctermOperator not mod eq ne gt le lt ge xor and or shr not shl
78 syn match CtermSymbols "|"
79 "syn keyword ctermOperators + - * / % = != > < >= <= & | ^ ! << >>
83 syn keyword ctermStatement off
84 syn keyword ctermStatement disk overwrite append spool none
85 syn keyword ctermStatement echo view wrap
89 "syn keyword ctermType
93 "syn keyword ctermLibFunc
94 "END USERLIB FUNCTIONS
97 syn keyword ctermLabel case default
101 syn keyword ctermConditional on endon
102 syn keyword ctermConditional proc endproc
103 syn keyword ctermConditional for in do endfor
104 syn keyword ctermConditional if else elseif endif iferror
105 syn keyword ctermConditional switch endswitch
106 syn keyword ctermConditional repeat until
110 syn keyword ctermRepeat while
113 " Function arguments (eg $1 $2 $3)
114 syn match ctermFuncArg "\$[1-9]"
116 syn keyword ctermTodo contained TODO
118 syn match ctermNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
119 "floating point number, with dot, optional exponent
120 syn match ctermNumber "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"
121 "floating point number, starting with a dot, optional exponent
122 syn match ctermNumber "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
123 "floating point number, without dot, with exponent
124 syn match ctermNumber "\<\d\+e[-+]\=\d\+[fl]\=\>"
126 syn match ctermNumber "0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
128 syn match ctermComment "![^=].*$" contains=ctermTodo
129 syn match ctermComment "!$"
130 syn match ctermComment "\*.*$" contains=ctermTodo
131 syn region ctermComment start="comment" end="$" contains=ctermTodo
132 syn region ctermComment start="remark" end="$" contains=ctermTodo
134 syn region ctermVar start="\$(" end=")"
136 " String and Character contstants
137 " Highlight special characters (those which have a backslash) differently
138 syn match ctermSpecial contained "\\\d\d\d\|\\."
139 syn match ctermSpecial contained "\^."
140 syn region ctermString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=ctermSpecial,ctermVar,ctermSymbols
141 syn match ctermCharacter "'[^\\]'"
142 syn match ctermSpecialCharacter "'\\.'"
144 " Define the default highlighting.
145 " For version 5.7 and earlier: only when not done already
146 " For version 5.8 and later: only when an item doesn't have highlighting yet
147 if version >= 508 || !exists("did_cterm_syntax_inits")
149 let did_cterm_syntax_inits = 1
150 command -nargs=+ HiLink hi link <args>
152 command -nargs=+ HiLink hi def link <args>
155 HiLink ctermStatement Statement
156 HiLink ctermFunction Statement
157 HiLink ctermStrFunction Statement
158 HiLink ctermIntFunction Statement
159 HiLink ctermLabel Statement
160 HiLink ctermConditional Statement
161 HiLink ctermRepeat Statement
162 HiLink ctermLibFunc UserDefFunc
163 HiLink ctermType Type
164 HiLink ctermFuncArg PreCondit
166 HiLink ctermPreVarRO PreCondit
167 HiLink ctermPreVarRW PreConditBold
170 HiLink ctermComment Comment
172 HiLink ctermCharacter SpecialChar
173 HiLink ctermSpecial Special
174 HiLink ctermSpecialCharacter SpecialChar
175 HiLink ctermSymbols Special
176 HiLink ctermString String
177 HiLink ctermTodo Todo
178 HiLink ctermOperator Statement
179 HiLink ctermNumber Number
181 " redefine the colors
182 "hi PreConditBold term=bold ctermfg=1 cterm=bold guifg=Purple gui=bold
183 "hi Special term=bold ctermfg=6 guifg=SlateBlue gui=underline
188 let b:current_syntax = "cterm"