blob: 139a0d5e173dcce9d92fca3a812926cdb3daf376 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: Century Term Command Script
3" Maintainer: Sean M. McKee <mckee@misslink.net>
4" Last Change: 2002 Apr 13
5" Version Info: @(#)cterm.vim 1.7 97/12/15 09:23:14
6
7" For version 5.x: Clear all syntax items
8" For version 6.x: Quit when a syntax file was already loaded
9if version < 600
10 syntax clear
11elseif exists("b:current_syntax")
12 finish
13endif
14
15syn case ignore
16
17"FUNCTIONS
18syn keyword ctermFunction abort addcr addlf answer at attr batch baud
19syn keyword ctermFunction break call capture cd cdelay charset cls color
20syn keyword ctermFunction combase config commect copy cread
21syn keyword ctermFunction creadint devprefix dialer dialog dimint
22syn keyword ctermFunction dimlog dimstr display dtimeout dwait edit
23syn keyword ctermFunction editor emulate erase escloop fcreate
24syn keyword ctermFunction fflush fillchar flags flush fopen fread
25syn keyword ctermFunction freadln fseek fwrite fwriteln get hangup
26syn keyword ctermFunction help hiwait htime ignore init itime
27syn keyword ctermFunction keyboard lchar ldelay learn lockfile
28syn keyword ctermFunction locktime log login logout lowait
29syn keyword ctermFunction lsend ltime memlist menu mkdir mode
30syn keyword ctermFunction modem netdialog netport noerror pages parity
31syn keyword ctermFunction pause portlist printer protocol quit rcv
32syn keyword ctermFunction read readint readn redial release
33syn keyword ctermFunction remote rename restart retries return
34syn keyword ctermFunction rmdir rtime run runx scrollback send
35syn keyword ctermFunction session set setcap setcolor setkey
36syn keyword ctermFunction setsym setvar startserver status
37syn keyword ctermFunction stime stopbits stopserver tdelay
38syn keyword ctermFunction terminal time trans type usend version
39syn keyword ctermFunction vi vidblink vidcard vidout vidunder wait
40syn keyword ctermFunction wildsize wclose wopen wordlen wru wruchar
41syn keyword ctermFunction xfer xmit xprot
42syn match ctermFunction "?"
43"syn keyword ctermFunction comment remark
44
45"END FUNCTIONS
46"INTEGER FUNCTIONS
47syn keyword ctermIntFunction asc atod eval filedate filemode filesize ftell
48syn keyword ctermIntFunction len termbits opsys pos sum time val mdmstat
49"END INTEGER FUNCTIONS
50
51"STRING FUNCTIONS
52syn keyword ctermStrFunction cdate ctime chr chrdy chrin comin getenv
53syn keyword ctermStrFunction gethomedir left midstr right str tolower
54syn keyword ctermStrFunction toupper uniq comst exists feof hascolor
55
56"END STRING FUNCTIONS
57
58"PREDEFINED TERM VARIABLES R/W
59syn keyword ctermPreVarRW f _escloop _filename _kermiteol _obufsiz
60syn keyword ctermPreVarRW _port _rcvsync _cbaud _reval _turnchar
61syn keyword ctermPreVarRW _txblksiz _txwindow _vmin _vtime _cparity
62syn keyword ctermPreVarRW _cnumber false t true _cwordlen _cstopbits
63syn keyword ctermPreVarRW _cmode _cemulate _cxprot _clogin _clogout
64syn keyword ctermPreVarRW _cstartsrv _cstopsrv _ccmdfile _cwru
65syn keyword ctermPreVarRW _cprotocol _captfile _cremark _combufsiz
66syn keyword ctermPreVarRW logfile
67"END PREDEFINED TERM VARIABLES R/W
68
69"PREDEFINED TERM VARIABLES R/O
70syn keyword ctermPreVarRO _1 _2 _3 _4 _5 _6 _7 _8 _9 _cursess
71syn keyword ctermPreVarRO _lockfile _baud _errno _retval _sernum
72syn keyword ctermPreVarRO _timeout _row _col _version
73"END PREDEFINED TERM VARIABLES R/O
74
75syn keyword ctermOperator not mod eq ne gt le lt ge xor and or shr not shl
76
77"SYMBOLS
78syn match CtermSymbols "|"
79"syn keyword ctermOperators + - * / % = != > < >= <= & | ^ ! << >>
80"END SYMBOLS
81
82"STATEMENT
83syn keyword ctermStatement off
84syn keyword ctermStatement disk overwrite append spool none
85syn keyword ctermStatement echo view wrap
86"END STATEMENT
87
88"TYPE
89"syn keyword ctermType
90"END TYPE
91
92"USERLIB FUNCTIONS
93"syn keyword ctermLibFunc
94"END USERLIB FUNCTIONS
95
96"LABEL
97syn keyword ctermLabel case default
98"END LABEL
99
100"CONDITIONAL
101syn keyword ctermConditional on endon
102syn keyword ctermConditional proc endproc
103syn keyword ctermConditional for in do endfor
104syn keyword ctermConditional if else elseif endif iferror
105syn keyword ctermConditional switch endswitch
106syn keyword ctermConditional repeat until
107"END CONDITIONAL
108
109"REPEAT
110syn keyword ctermRepeat while
111"END REPEAT
112
113" Function arguments (eg $1 $2 $3)
114syn match ctermFuncArg "\$[1-9]"
115
116syn keyword ctermTodo contained TODO
117
118syn match ctermNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
119"floating point number, with dot, optional exponent
120syn match ctermNumber "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"
121"floating point number, starting with a dot, optional exponent
122syn match ctermNumber "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
123"floating point number, without dot, with exponent
124syn match ctermNumber "\<\d\+e[-+]\=\d\+[fl]\=\>"
125"hex number
126syn match ctermNumber "0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
127
128syn match ctermComment "![^=].*$" contains=ctermTodo
129syn match ctermComment "!$"
130syn match ctermComment "\*.*$" contains=ctermTodo
131syn region ctermComment start="comment" end="$" contains=ctermTodo
132syn region ctermComment start="remark" end="$" contains=ctermTodo
133
134syn region ctermVar start="\$(" end=")"
135
136" String and Character contstants
137" Highlight special characters (those which have a backslash) differently
138syn match ctermSpecial contained "\\\d\d\d\|\\."
139syn match ctermSpecial contained "\^."
140syn region ctermString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=ctermSpecial,ctermVar,ctermSymbols
141syn match ctermCharacter "'[^\\]'"
142syn match ctermSpecialCharacter "'\\.'"
143
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
147if version >= 508 || !exists("did_cterm_syntax_inits")
148 if version < 508
149 let did_cterm_syntax_inits = 1
150 command -nargs=+ HiLink hi link <args>
151 else
152 command -nargs=+ HiLink hi def link <args>
153 endif
154
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
165
166 HiLink ctermPreVarRO PreCondit
167 HiLink ctermPreVarRW PreConditBold
168 HiLink ctermVar Type
169
170 HiLink ctermComment Comment
171
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
180
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
184
185 delcommand HiLink
186endif
187
188let b:current_syntax = "cterm"
189
190" vim: ts=8