2 " Language: eterm(1) configuration file
3 " Maintainer: Nikolai Weibull <now@bitwi.se>
4 " Latest Revision: 2006-04-21
6 if exists("b:current_syntax")
13 syn keyword etermTodo contained TODO FIXME XXX NOTE
15 syn region etermComment display oneline start='^#' end='$'
16 \ contains=etermTodo,@Spell
18 syn match etermMagic display '^<Eterm-[0-9.]\+>$'
20 syn match etermNumber contained display '\<\(\d\+\|0x\x\{1,2}\)\>'
22 syn region etermString contained display oneline start=+"+
25 syn keyword etermBoolean contained on off true false yes no
27 syn keyword etermPreProc contained appname exec get put random version
30 syn keyword etermFunctions contained copy exit kill nop paste save
33 syn cluster etermGeneral contains=etermComment,etermFunction,
36 syn keyword etermKeyMod contained ctrl shift lock mod1 mod2 mod3 mod4
37 \ mod5 alt meta anymod
38 syn keyword etermKeyMod contained button1 button2 button3 button4
41 syn keyword etermColorOptions contained video nextgroup=etermVideoOptions
44 syn keyword etermVideoType contained normal reverse
46 syn keyword etermColorOptions contained foreground background cursor
48 \ nextgroup=etermColorType skipwhite
50 syn keyword etermColorType contained bd ul
51 syn match etermColorType contained display '\<\%(\d\|1[0-5]\)'
53 syn keyword etermColorOptions contained color
54 \ nextgroup=etermColorNumber skipwhite
56 syn keyword etermColorNumber contained bd ul nextgroup=etermColorSpec
58 syn match etermColorNumber contained display '\<\%(\d\|1[0-5]\)'
59 \ nextgroup=etermColorSpec skipwhite
61 syn match etermColorSpec contained display '\S\+'
63 syn region etermColorContext fold transparent matchgroup=etermContext
64 \ start='^\s*begin\s\+color\>'
66 \ contains=@etermGeneral,etermColorOptions
68 syn keyword etermAttrOptions contained geometry nextgroup=etermGeometry
71 syn match etermGeometry contained display '\d\+x\d++\d\++\d\+'
73 syn keyword etermAttrOptions contained scrollbar_type
74 \ nextgroup=etermScrollbarType skipwhite
76 syn keyword etermScrollbarType contained motif xterm next
78 syn keyword etermAttrOptions contained font nextgroup=etermFontType
81 syn keyword etermFontType contained bold nextgroup=etermFont skipwhite
82 syn match etermFontType contained display '[0-5]' nextgroup=etermFont
85 syn match etermFont contained display '\S\+'
87 syn keyword etermFontType contained default nextgroup=etermNumber
90 syn keyword etermFontType contained proportional nextgroup=etermBoolean
93 syn keyword etermFontType contained fx nextgroup=etermString skipwhite
95 syn keyword etermAttrOptions contained title name iconname
96 \ nextgroup=etermString skipwhite
98 syn keyword etermAttrOptions contained scrollbar_width desktop
99 \ nextgroup=etermNumber skipwhite
101 syn region etermAttrContext fold transparent matchgroup=etermContext
102 \ start='^\s*begin\s\+attributes\>'
104 \ contains=@etermGeneral,etermAttrOptions
106 syn keyword etermIClassOptions contained icon path nextgroup=etermString
108 syn keyword etermIClassOptions contained cache nextgroup=etermNumber
110 syn keyword etermIClassOptions contained anim nextgroup=etermNumber
113 syn region etermIClassContext fold transparent matchgroup=etermContext
114 \ start='^\s*begin\s\+imageclasses\>'
116 \ contains=@etermGeneral,etermImageContext,
119 syn keyword etermImageOptions contained type nextgroup=etermImageType
122 syn keyword etermImageTypes contained background trough anchor up_arrow
123 \ left_arrow right_arrow menu menuitem
124 \ submenu button buttonbar down_arrow
126 syn keyword etermImageOptions contained mode nextgroup=etermImageModes
129 syn keyword etermImageModes contained image trans viewport auto solid
130 \ nextgroup=etermImageModesAllow skipwhite
131 syn keyword etermImageModesAllow contained allow nextgroup=etermImageModesR
133 syn keyword etermImageModesR contained image trans viewport auto solid
135 syn keyword etermImageOptions contained state nextgroup=etermImageState
138 syn keyword etermImageState contained normal selected clicked disabled
140 syn keyword etermImageOptions contained color nextgroup=etermImageColorFG
143 syn keyword etermImageColorFG contained '\S\+' nextgroup=etermImageColorBG
146 syn keyword etermImageColorBG contained '\S\+'
148 syn keyword etermImageOptions contained file nextgroup=etermString
151 syn keyword etermImageOptions contained geom nextgroup=etermImageGeom
154 syn match etermImageGeom contained display
155 \ '\s\+\%(\d\+x\d\++\d\++\d\+\)\=:\%(\%(tie\|scale\|hscale\|vscale\|propscale\)d\=\)\='
157 syn keyword etermImageOptions contained cmod colormod
158 \ nextgroup=etermImageCmod skipwhite
160 syn keyword etermImageCmod contained image red green blue
161 \ nextgroup=etermImageBrightness skipwhite
163 syn match etermImageBrightness contained display '\<\(\d\+\|0x\x\{1,2}\)\>'
164 \ nextgroup=etermImageContrast skipwhite
166 syn match etermImageContrast contained display '\<\(\d\+\|0x\x\{1,2}\)\>'
167 \ nextgroup=etermImageGamma skipwhite
169 syn match etermImageGamma contained display '\<\(\d\+\|0x\x\{1,2}\)\>'
170 \ nextgroup=etermImageGamma skipwhite
172 syn region etermImageOptions contained display oneline
173 \ matchgroup=etermImageOptions
174 \ start='border\|bevel\%(\s\+\%(up\|down\)\)\|padding'
175 \ end='$' contains=etermNumber
177 syn region etermImageContext contained fold transparent
178 \ matchgroup=etermContext
179 \ start='^\s*begin\s\+image\>'
181 \ contains=@etermGeneral,etermImageOptions
183 syn keyword etermMenuItemOptions contained action
184 \ nextgroup=etermMenuItemAction skipwhite
186 syn keyword etermMenuItemAction contained string echo submenu script
187 \ nextgroup=etermString skipwhite
189 syn keyword etermMenuItemAction contained separator
191 syn keyword etermMenuItemOptions contained text rtext nextgroup=etermString
194 syn region etermMenuItemContext contained fold transparent
195 \ matchgroup=etermContext
196 \ start='^\s*begin\s\+menuitem\>'
198 \ contains=@etermGeneral,etermMenuItemOptions
200 syn keyword etermMenuOptions contained title nextgroup=etermString
203 syn keyword etermMenuOptions contained font_name nextgroup=etermFont
206 syn match etermMenuOptions contained display '\<sep\>\|-'
208 syn region etermMenuContext fold transparent matchgroup=etermContext
209 \ start='^\s*begin\s\+menu\>'
211 \ contains=@etermGeneral,etermMenuOptions,
212 \ etermMenuItemContext
214 syn keyword etermBind contained bind nextgroup=etermBindMods
217 syn keyword etermBindMods contained ctrl shift lock mod1 mod2 mod3 mod4
218 \ mod5 alt meta anymod
219 \ nextgroup=etermBindMods skipwhite
221 syn keyword etermBindTo contained to nextgroup=etermBindType
224 syn keyword etermBindType contained string echo menu script
225 \ nextgroup=etermBindParam skipwhite
227 syn match etermBindParam contained display '\S\+'
229 syn region etermActionsContext fold transparent matchgroup=etermContext
230 \ start='^\s*begin\s\+actions\>'
232 \ contains=@etermGeneral,etermActionsOptions
234 syn keyword etermButtonOptions contained font nextgroup=etermFont skipwhite
235 syn keyword etermButtonOptions contained visible nextgroup=etermBoolean
237 syn keyword etermButtonOptions contained dock nextgroup=etermDockOption
240 syn keyword etermDockOption contained top bottom no
242 syn keyword etermButton contained button nextgroup=etermButtonText
245 syn region etermButtonText contained display oneline start=+"+
247 \ nextgroup=etermButtonIcon skipwhite
249 syn keyword etermButtonIcon contained icon nextgroup=etermButtonIconFile
252 syn keyword etermButtonIconFile contained '\S\+' nextgroup=etermButtonAction
255 syn keyword etermButtonAction contained action nextgroup=etermBindType
258 syn region etermButtonContext fold transparent matchgroup=etermContext
259 \ start='^\s*begin\s\+button_bar\>'
261 \ contains=@etermGeneral,etermButtonOptions
263 syn keyword etermMultiOptions contained encoding nextgroup=etermEncoding
266 syn keyword etermEncoding eucj sjis euckr big5 gb
267 syn match etermEncoding display 'iso-10646'
269 syn keyword etermMultiOptions contained font nextgroup=etermFontType
272 syn region etermMultiContext fold transparent matchgroup=etermContext
273 \ start='^\s*begin\s\+multichar\>'
275 \ contains=@etermGeneral,etermMultiOptions
277 syn keyword etermXimOptions contained input_method
278 \ nextgroup=etermInputMethod skipwhite
280 syn match etermInputMethod contained display '\S+'
282 syn keyword etermXimOptions contained preedit_type
283 \ nextgroup=etermPreeditType skipwhite
285 syn keyword etermPreeditType contained OverTheSpot OffTheSpot Root
287 syn region etermXimContext fold transparent matchgroup=etermContext
288 \ start='^\s*begin\s\+xim\>'
290 \ contains=@etermGeneral,etermXimOptions
292 syn keyword etermTogOptions contained map_alert visual_bell login_shell
293 \ scrollbar utmp_logging meta8 iconic
294 \ no_input home_on_output home_on_input
295 \ scrollbar_floating scrollbar_right
296 \ scrollbar_popup borderless double_buffer
297 \ no_cursor pause xterm_select select_line
298 \ select_trailing_spaces report_as_keysyms
299 \ itrans immotile_trans buttonbar
300 \ resize_gravity nextgroup=etermBoolean
303 syn region etermTogContext fold transparent matchgroup=etermContext
304 \ start='^\s*begin\s\+toggles\>'
306 \ contains=@etermGeneral,etermTogOptions
308 syn keyword etermKeyboardOptions contained smallfont_key bigfont_key keysym
309 \ nextgroup=etermKeysym skipwhite
311 syn keyword etermKeysym contained '\S\+' nextgroup=etermString
314 syn keyword etermKeyboardOptions contained meta_mod alt_mod numlock_mod
315 \ nextgroup=etermNumber skipwhite
317 syn keyword etermKeyboardOptions contained greek app_keypad app_cursor
318 \ nextgroup=etermBoolean skipwhite
320 syn region etermKeyboardContext fold transparent matchgroup=etermContext
321 \ start='^\s*begin\s\+keyboard\>'
323 \ contains=@etermGeneral,etermKeyboardOptions
325 syn keyword etermMiscOptions contained print_pipe cut_chars finished_title
326 \ finished_text term_name exec
327 \ nextgroup=etermString skipwhite
329 syn keyword etermMiscOptions contained save_lines min_anchor_size
330 \ border_width line_space
332 syn region etermMiscContext fold transparent matchgroup=etermContext
333 \ start='^\s*begin\s\+misc\>'
335 \ contains=@etermGeneral,etermMiscOptions
337 syn keyword etermEScreenOptions contained url nextgroup=etermURL skipwhite
339 syn match etermURL contained display
340 \ '\<\%(screen\|twin\)://\%([^@:/]\+\%(@[^:/]\+\%(:[^/]\+\)\=\)\=\)\=/\S\+'
342 syn keyword etermEScreenOptions contained firewall
344 syn keyword etermEScreenOptions contained delay nextgroup=etermNumber
347 syn keyword etermEScreenOptions contained bbar_font nextgroup=etermFont
350 syn keyword etermEScreenOptions contained bbar_dock nextgroup=etermDockOption
353 syn region etermEScreenContext fold transparent matchgroup=etermContext
354 \ start='^\s*begin\s\+escreen\>'
356 \ contains=@etermGeneral,etermEScreenOptions
358 if exists("eterm_minlines")
359 let b:eterm_minlines = eterm_minlines
361 let b:eterm_minlines = 50
363 exec "syn sync minlines=" . b:eterm_minlines
365 hi def link etermTodo Todo
366 hi def link etermComment Comment
367 hi def link etermMagic PreProc
368 hi def link etermNumber Number
369 hi def link etermString String
370 hi def link etermBoolean Boolean
371 hi def link etermPreProc PreProc
372 hi def link etermFunctions Function
373 hi def link etermKeyMod Constant
374 hi def link etermOption Keyword
375 hi def link etermColorOptions etermOption
376 hi def link etermColor String
377 hi def link etermVideoType Type
378 hi def link etermColorType Type
379 hi def link etermColorNumber Number
380 hi def link etermColorSpec etermColor
381 hi def link etermContext Keyword
382 hi def link etermAttrOptions etermOption
383 hi def link etermGeometry String
384 hi def link etermScrollbarType Type
385 hi def link etermFontType Type
386 hi def link etermIClassOptions etermOption
387 hi def link etermImageOptions etermOption
388 hi def link etermImageTypes Type
389 hi def link etermImageModes Type
390 hi def link etermImageModesAllow Keyword
391 hi def link etermImageModesR Type
392 hi def link etermImageState Keyword
393 hi def link etermImageColorFG etermColor
394 hi def link etermImageColorBG etermColor
395 hi def link etermImageGeom String
396 hi def link etermImageCmod etermOption
397 hi def link etermImageBrightness Number
398 hi def link etermImageContrast Number
399 hi def link etermImageGamma Number
400 hi def link etermMenuItemOptions etermOption
401 hi def link etermMenuItemAction Keyword
402 hi def link etermMenuOptions etermOption
403 hi def link etermBind Keyword
404 hi def link etermBindMods Identifier
405 hi def link etermBindTo Keyword
406 hi def link etermBindType Type
407 hi def link etermBindParam String
408 hi def link etermButtonOptions etermOption
409 hi def link etermDockOption etermOption
410 hi def link etermButtonText String
411 hi def link etermButtonIcon String
412 hi def link etermButtonIconFile String
413 hi def link etermButtonAction Keyword
414 hi def link etermMultiOptions etermOption
415 hi def link etermEncoding Identifier
416 hi def link etermXimOptions etermOption
417 hi def link etermInputMethod Identifier
418 hi def link etermPreeditType Type
419 hi def link etermTogOptions etermOption
420 hi def link etermKeyboardOptions etermOption
421 hi def link etermKeysym Constant
422 hi def link etermMiscOptions etermOption
423 hi def link etermEScreenOptions etermOption
424 hi def link etermURL Identifier
426 let b:current_syntax = "eterm"
428 let &cpo = s:cpo_save