summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/mrxvtrc.vim
blob: 2ef434d2b2331b8aa733553bc51bee5bdc659828 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
" Description	: Vim syntax file for mrxvtrc (for mrxvt-0.5.0 and up)
" Created	: Wed 26 Apr 2006 01:20:53 AM CDT
" Modified	: Thu 02 Feb 2012 08:37:45 PM EST
" Maintainer	: GI <a@b.c>, where a='gi1242+vim', b='gmail', c='com'

" Quit when a syntax file was already loaded
if exists("b:current_syntax")
  finish
endif

let s:cpo_save = &cpo
set cpo&vim

syn case match

" Errors
syn match	mrxvtrcError	contained	'\v\S+'

" Comments
syn match	mrxvtrcComment	contains=@Spell '^\s*[!#].*$'
syn match	mrxvtrcComment	'\v^\s*[#!]\s*\w+[.*]\w+.*:.*'

"
" Options.
"
syn match	mrxvtrcClass	'\v^\s*\w+[.*]'
	    \ nextgroup=mrxvtrcOptions,mrxvtrcProfile,@mrxvtrcPOpts,mrxvtrcError

" Boolean options
syn keyword	mrxvtrcOptions	contained nextgroup=mrxvtrcBColon,mrxvtrcError
				\ highlightTabOnBell syncTabTitle hideTabbar
				\ autohideTabbar bottomTabbar hideButtons
				\ syncTabIcon veryBoldFont maximized
				\ fullscreen reverseVideo loginShell
				\ jumpScroll scrollBar scrollbarRight
				\ scrollbarFloating scrollTtyOutputInhibit
				\ scrollTtyKeypress transparentForce
				\ transparentScrollbar transparentMenubar
				\ transparentTabbar tabUsePixmap utmpInhibit
				\ visualBell mapAlert meta8
				\ mouseWheelScrollPage multibyte_cursor
				\ tripleclickwords showMenu xft xftNomFont
				\ xftSlowOutput xftAntialias xftHinting
				\ xftAutoHint xftGlobalAdvance cmdAllTabs
				\ protectSecondary thai borderLess
				\ overrideRedirect broadcast smartResize
				\ pointerBlank cursorBlink noSysConfig
				\ disableMacros linuxHomeEndKey sessionMgt
				\ boldColors smoothResize useFifo veryBright
syn match	mrxvtrcOptions	contained nextgroup=mrxvtrcBColon,mrxvtrcError
				\ '\v<transparent>'
syn match	mrxvtrcBColon	contained skipwhite
				\ nextgroup=mrxvtrcBoolVal,mrxvtrcError ':'
syn case ignore
syn keyword	mrxvtrcBoolVal	contained skipwhite nextgroup=mrxvtrcError
				\ 0 1 yes no on off true false
syn case match

" Color options
syn keyword	mrxvtrcOptions	contained nextgroup=mrxvtrcCColon,mrxvtrcError
				\ ufBackground textShadow tabForeground
				\ itabForeground tabBackground itabBackground
				\ scrollColor troughColor highlightColor
				\ cursorColor cursorColor2 pointerColor
				\ borderColor tintColor
syn match	mrxvtrcOptions	contained nextgroup=mrxvtrcCColon,mrxvtrcError
				\ '\v<color([0-9]|1[0-5]|BD|UL|RV)>'
syn match	mrxvtrcCColon	contained skipwhite
				\ nextgroup=mrxvtrcColorVal ':'
syn match	mrxvtrcColorVal	contained skipwhite nextgroup=mrxvtrcError
				\ '\v#[0-9a-fA-F]{6}'

" Numeric options
syn keyword	mrxvtrcOptions	contained nextgroup=mrxvtrcNColon,mrxvtrcError
				\ maxTabWidth minVisibleTabs
				\ scrollbarThickness xftmSize xftSize desktop
				\ externalBorder internalBorder lineSpace
				\ pointerBlankDelay cursorBlinkInterval
				\ shading backgroundFade bgRefreshInterval
				\ fading opacity opacityDegree xftPSize
syn match	mrxvtrcNColon	contained skipwhite
				\ nextgroup=mrxvtrcNumVal,mrxvtrcError ':'
syn match	mrxvtrcNumVal	contained skipwhite nextgroup=mrxvtrcError
				\ '\v[+-]?<(0[0-7]+|\d+|0x[0-9a-f]+)>'

" String options
syn keyword	mrxvtrcOptions	contained nextgroup=mrxvtrcSColon,mrxvtrcError
				\ tabTitle termName title clientName iconName
				\ bellCommand backspaceKey deleteKey
				\ printPipe cutChars answerbackString
				\ smClientID geometry path boldFont xftFont
				\ xftmFont xftPFont inputMethod
				\ greektoggle_key menu menubarPixmap
				\ scrollbarPixmap tabbarPixmap appIcon
				\ multichar_encoding initProfileList
syn match	mrxvtrcOptions	contained nextgroup=mrxvtrcSColon,mrxvtrcError
				\ '\v<m?font[1-5]?>'
syn match	mrxvtrcSColon	contained skipwhite nextgroup=mrxvtrcStrVal ':'
syn match	mrxvtrcStrVal	contained '\v\S.*'

" Profile options
syn cluster	mrxvtrcPOpts	contains=mrxvtrcPSOpts,mrxvtrcPCOpts,mrxvtrcPNOpts
syn match	mrxvtrcProfile	contained nextgroup=@mrxvtrcPOpts,mrxvtrcError
				\ '\vprofile\d+\.'
syn keyword	mrxvtrcPSOpts	contained nextgroup=mrxvtrcSColon,mrxvtrcError
				\ tabTitle command holdExitText holdExitTitle
				\ Pixmap workingDirectory titleFormat
				\ winTitleFormat
syn keyword	mrxvtrcPCOpts	contained nextgroup=mrxvtrcCColon,mrxvtrcError
				\ background foreground
syn keyword	mrxvtrcPNOpts	contained nextgroup=mrxvtrcNColon,mrxvtrcError
				\ holdExit saveLines

" scrollbarStyle
syn match	mrxvtrcOptions	contained skipwhite
				\ nextgroup=mrxvtrcSBstyle,mrxvtrcError
				\ '\v<scrollbarStyle:'
syn keyword	mrxvtrcSBstyle	contained skipwhite nextgroup=mrxvtrcError
				\ plain xterm rxvt next sgi

" scrollbarAlign
syn match	mrxvtrcOptions	contained skipwhite
				\ nextgroup=mrxvtrcSBalign,mrxvtrcError
				\ '\v<scrollbarAlign:'
syn keyword	mrxvtrcSBalign	contained skipwhite nextgroup=mrxvtrcError
				\ top bottom

" textShadowMode
syn match	mrxvtrcOptions	contained skipwhite
				\ nextgroup=mrxvtrcTSmode,mrxvtrcError
				\ '\v<textShadowMode:'
syn keyword	mrxvtrcTSmode	contained skipwhite nextgroup=mrxvtrcError
				\ none top bottom left right topleft topright
				\ botleft botright

" greek_keyboard
syn match	mrxvtrcOptions	contained skipwhite
				\ nextgroup=mrxvtrcGrkKbd,mrxvtrcError
				\ '\v<greek_keyboard:'
syn keyword	mrxvtrcGrkKbd	contained skipwhite nextgroup=mrxvtrcError
				\ iso ibm

" xftWeight
syn match	mrxvtrcOptions	contained skipwhite
				\ nextgroup=mrxvtrcXftWt,mrxvtrcError
				\ '\v<(xftWeight|xftBoldWeight):'
syn keyword	mrxvtrcXftWt	contained skipwhite nextgroup=mrxvtrcError
				\ light medium demibold bold black

" xftSlant
syn match	mrxvtrcOptions	contained skipwhite
				\ nextgroup=mrxvtrcXftSl,mrxvtrcError
				\ '\v<xftSlant:'
syn keyword	mrxvtrcXftSl	contained skipwhite nextgroup=mrxvtrcError
				\ roman italic oblique

" xftWidth
syn match	mrxvtrcOptions	contained skipwhite
				\ nextgroup=mrxvtrcXftWd,mrxvtrcError
				\ '\v<xftWidth:'
syn keyword	mrxvtrcXftWd	contained skipwhite nextgroup=mrxvtrcError
				\ ultracondensed ultraexpanded
				\ condensed expanded normal

" xftRGBA
syn match	mrxvtrcOptions	contained skipwhite
				\ nextgroup=mrxvtrcXftHt,mrxvtrcError
				\ '\v<xftRGBA:'
syn keyword	mrxvtrcXftHt	contained skipwhite nextgroup=mrxvtrcError
				\ rgb bgr vrgb vbgr none

" preeditType
syn match	mrxvtrcOptions	contained skipwhite
				\ nextgroup=mrxvtrcPedit,mrxvtrcError
				\ '\v<preeditType:'
syn keyword	mrxvtrcPedit	contained skipwhite nextgroup=mrxvtrcError
				\ OverTheSpot OffTheSpot Root

" modifier
syn match	mrxvtrcOptions	contained skipwhite
				\ nextgroup=mrxvtrcMod,mrxvtrcError
				\ '\v<modifier:'
syn keyword	mrxvtrcMod	contained skipwhite nextgroup=mrxvtrcError
				\ alt meta hyper super mod1 mod2 mod3 mod4 mod5

" selectStyle
syn match	mrxvtrcOptions	contained skipwhite
				\ nextgroup=mrxvtrcSelSty,mrxvtrcError
				\ '\v<selectStyle:'
syn keyword	mrxvtrcSelSty	contained skipwhite nextgroup=mrxvtrcError
				\ old oldword


"
" Macros
"
syn keyword	mrxvtrcOptions	contained nextgroup=mrxvtrcKey,mrxvtrcError
				\ macro
syn case ignore
syn match	mrxvtrcKey	contained skipwhite
			    \ nextgroup=mrxvtrcMacro,mrxvtrcError
			    \ '\v\.((primary|add|ctrl|alt|meta|shift)\+)*\w+:'
syn case match

" Macros without arguments
syn keyword	mrxvtrcMacro	contained skipwhite nextgroup=mrxvtrcError
				\ Dummy Copy Paste ToggleVeryBold
				\ ToggleTransparency ToggleBroadcast
				\ ToggleHold SetTitle ToggleMacros
				\ ToggleFullscreen Raise

" Macros with a string argument
syn keyword	mrxvtrcMacro	contained skipwhite nextgroup=mrxvtrcStrVal
				\ Esc Str Exec Scroll PrintScreen SaveConfig

" Macros with a numeric argument
syn keyword	mrxvtrcMacro	contained skipwhite
				\ nextgroup=mrxvtrcNumVal,mrxvtrcError
				\ Close GotoTab MoveTab ResizeFont UseFifo

" NewTab macro
syn keyword	mrxvtrcMacro	contained skipwhite
				\ nextgroup=mrxvtrcTitle,mrxvtrcShell,mrxvtrcCmd
				\ NewTab
syn region	mrxvtrcTitle	contained oneline skipwhite
				\ nextgroup=mrxvtrcShell,mrxvtrcCmd
				\ start='"' end='"'
syn match	mrxvtrcShell	contained nextgroup=mrxvtrcCmd '!' 
syn match	mrxvtrcCmd	contained '\v[^!" \t].*'

" ToggleSubwin macro
syn keyword	mrxvtrcMacro	contained skipwhite
				\ nextgroup=mrxvtrcSubwin,mrxvtrcError
				\ ToggleSubwin
syn match	mrxvtrcSubwin	contained skipwhite nextgroup=mrxvtrcError
				\ '\v[-+]?[bmst]>'

"
" Highlighting groups
"
hi def link mrxvtrcError	Error
hi def link mrxvtrcComment	Comment

hi def link mrxvtrcClass	Statement
hi def link mrxvtrcOptions	mrxvtrcClass
hi def link mrxvtrcBColon	mrxvtrcClass
hi def link mrxvtrcCColon	mrxvtrcClass
hi def link mrxvtrcNColon	mrxvtrcClass
hi def link mrxvtrcSColon	mrxvtrcClass
hi def link mrxvtrcProfile	mrxvtrcClass
hi def link mrxvtrcPSOpts	mrxvtrcClass
hi def link mrxvtrcPCOpts	mrxvtrcClass
hi def link mrxvtrcPNOpts	mrxvtrcClass

hi def link mrxvtrcBoolVal	Boolean
hi def link mrxvtrcStrVal	String
hi def link mrxvtrcColorVal	Constant
hi def link mrxvtrcNumVal	Number

hi def link mrxvtrcSBstyle	mrxvtrcStrVal
hi def link mrxvtrcSBalign	mrxvtrcStrVal
hi def link mrxvtrcTSmode	mrxvtrcStrVal
hi def link mrxvtrcGrkKbd	mrxvtrcStrVal
hi def link mrxvtrcXftWt	mrxvtrcStrVal
hi def link mrxvtrcXftSl	mrxvtrcStrVal
hi def link mrxvtrcXftWd	mrxvtrcStrVal
hi def link mrxvtrcXftHt	mrxvtrcStrVal
hi def link mrxvtrcPedit	mrxvtrcStrVal
hi def link mrxvtrcMod		mrxvtrcStrVal
hi def link mrxvtrcSelSty	mrxvtrcStrVal

hi def link mrxvtrcMacro	Identifier
hi def link mrxvtrcKey		mrxvtrcClass
hi def link mrxvtrcTitle	mrxvtrcStrVal
hi def link mrxvtrcShell	Special
hi def link mrxvtrcCmd		PreProc
hi def link mrxvtrcSubwin	mrxvtrcStrVal

let b:current_syntax = "mrxvtrc"

let &cpo = s:cpo_save
unlet s:cpo_save