2 " Maintainer: Nikolai Weibull <now@bitwi.se>
3 " Latest Revision: 2006-07-22
5 if exists("b:current_syntax")
12 setlocal iskeyword=@,48-57,_,-
14 syn keyword cmusrcTodo contained TODO FIXME XXX NOTE
16 syn match cmusrcComment contained display '^\s*#.*$'
18 syn match cmusrcBegin display '^'
19 \ nextgroup=cmusrcKeyword,cmusrcComment
22 syn keyword cmusrcKeyword contained add
23 \ nextgroup=cmusrcAddSwitches,cmusrcURI
26 syn match cmusrcAddSwitches contained display '-[lpqQ]'
30 syn match cmusrcURI contained display '.\+'
32 syn keyword cmusrcKeyword contained bind
33 \ nextgroup=cmusrcBindSwitches,
37 syn match cmusrcBindSwitches contained display '-[f]'
38 \ nextgroup=cmusrcBindContext
41 syn keyword cmusrcBindContext contained common library playlist queue
43 \ nextgroup=cmusrcBindKey
46 syn match cmusrcBindKey contained display '\S\+'
47 \ nextgroup=cmusrcKeyword
50 syn keyword cmusrcKeyword contained browser-up colorscheme echo factivate
51 \ filter invert player-next player-pause
52 \ player-play player-prev player-stop quit
53 \ refresh run search-next search-prev shuffle
54 \ unmark win-activate win-add-l win-add-p
55 \ win-add-Q win-add-q win-bottom win-down
56 \ win-mv-after win-mv-before win-next
57 \ win-page-down win-page-up win-remove
58 \ win-sel-cur win-toggle win-top win-up
61 syn keyword cmusrcKeyword contained cd
62 \ nextgroup=cmusrcDirectory
65 syn match cmusrcDirectory contained display '.\+'
67 syn keyword cmusrcKeyword contained clear
68 \ nextgroup=cmusrcClearSwitches
70 syn match cmusrcClearSwitches contained display '-[lpq]'
72 syn keyword cmusrcKeyword contained fset
73 \ nextgroup=cmusrcFSetName
76 syn match cmusrcFSetName contained display '[^=]\+'
77 \ nextgroup=cmusrcFSetEq
79 syn match cmusrcFSetEq contained display '='
80 \ nextgroup=cmusrcFilterExpr
82 syn match cmusrcFilterExpr contained display '.\+'
84 syn keyword cmusrcKeyword contained load
85 \ nextgroup=cmusrcLoadSwitches,cmusrcURI
88 syn match cmusrcLoadSwitches contained display '-[lp]'
92 syn keyword cmusrcKeyword contained mark
93 \ nextgroup=cmusrcFilterExpr
95 syn keyword cmusrcKeyword contained save
96 \ nextgroup=cmusrcSaveSwitches,cmusrcFile
99 syn match cmusrcSaveSwitches contained display '-[lp]'
100 \ nextgroup=cmusrcFile
103 syn match cmusrcFile contained display '.\+'
105 syn keyword cmusrcKeyword contained seek
106 \ nextgroup=cmusrcSeekOffset
109 syn match cmusrcSeekOffset contained display
110 \ '[+-]\=\%(\d\+[mh]\=\|\%(\%(0\=\d\|[1-5]\d\):\)\=\%(0\=\d\|[1-5]\d\):\%(0\=\d\|[1-5]\d\)\)'
112 syn keyword cmusrcKeyword contained set
113 \ nextgroup=cmusrcOption
116 syn keyword cmusrcOption contained auto_reshuffle confirm_run
117 \ continue play_library play_sorted repeat
118 \ show_hidden show_remaining_time shuffle
119 \ nextgroup=cmusrcSetTest,cmusrcOptEqBoolean
121 syn match cmusrcSetTest contained display '?'
123 syn match cmusrcOptEqBoolean contained display '='
124 \ nextgroup=cmusrcOptBoolean
126 syn keyword cmusrcOptBoolean contained true false
128 syn keyword cmusrcOption contained aaa_mode
129 \ nextgroup=cmusrcOptEqAAA
131 syn match cmusrcOptEqAAA contained display '='
132 \ nextgroup=cmusrcOptAAA
134 syn keyword cmusrcOptAAA contained all artist album
136 syn keyword cmusrcOption contained buffer_seconds
137 \ nextgroup=cmusrcOptEqNumber
139 syn match cmusrcOptEqNumber contained display '='
140 \ nextgroup=cmusrcOptNumber
142 syn match cmusrcOptNumber contained display '\d\+'
144 syn keyword cmusrcOption contained altformat_current altformat_playlist
145 \ altformat_title altformat_trackwin
146 \ format_current format_playlist format_title
148 \ nextgroup=cmusrcOptEqFormat
150 syn match cmusrcOptEqFormat contained display '='
151 \ nextgroup=cmusrcOptFormat
153 syn match cmusrcOptFormat contained display '.\+'
154 \ contains=cmusrcFormatSpecial
156 syn match cmusrcFormatSpecial contained display '%[0-]*\d*[alDntgydfF=%]'
158 syn keyword cmusrcOption contained color_cmdline_bg color_cmdline_fg
159 \ color_error color_info color_separator
160 \ color_statusline_bg color_statusline_fg
161 \ color_titleline_bg color_titleline_fg
162 \ color_win_bg color_win_cur
163 \ color_win_cur_sel_bg color_win_cur_sel_fg
164 \ color_win_dir color_win_fg
165 \ color_win_inactive_cur_sel_bg
166 \ color_win_inactive_cur_sel_fg
167 \ color_win_inactive_sel_bg
168 \ color_win_inactive_sel_fg
169 \ color_win_sel_bg color_win_sel_fg
170 \ color_win_title_bg color_win_title_fg
171 \ nextgroup=cmusrcOptEqColor
173 syn match cmusrcOptEqColor contained display '='
174 \ nextgroup=@cmusrcOptColor
176 syn cluster cmusrcOptColor contains=cmusrcOptColorName,cmusrcOptColorValue
178 syn keyword cmusrcOptColorName contained default black red green yellow blue
179 \ magenta cyan gray darkgray lightred lightred
180 \ lightgreen lightyellow lightblue lightmagenta
183 syn match cmusrcOptColorValue contained display
184 \ '-1\|0*\%(\d\|[1-9]\d\|1\d\d\|2\%([0-4]\d\|5[0-5]\)\)'
186 syn keyword cmusrcOption contained id3_default_charset output_plugin
187 \ status_display_program
188 \ nextgroup=cmusrcOptEqString
190 syn match cmusrcOption contained
191 \ '\%(dsp\|mixer\)\.\%(alsa\|oss\|sun\)\.\%(channel\|device\)'
192 \ nextgroup=cmusrcOptEqString
194 syn match cmusrcOption contained
195 \ 'dsp\.ao\.\%(buffer_size\|driver\|wav_counter\|wav_dir\)'
196 \ nextgroup=cmusrcOptEqString
198 syn match cmusrcOptEqString contained display '='
199 \ nextgroup=cmusrcOptString
201 syn match cmusrcOptString contained display '.\+'
203 syn keyword cmusrcOption contained lib_sort pl_sort
204 \ nextgroup=cmusrcOptEqSortKeys
206 syn match cmusrcOptEqSortKeys contained display '='
207 \ nextgroup=cmusrcOptSortKeys
209 syn keyword cmusrcOptSortKeys contained artist album title tracknumber
210 \ discnumber date genre filename
211 \ nextgroup=cmusrcOptSortKeys
214 syn keyword cmusrcKeyword contained showbind
215 \ nextgroup=cmusrcSBindContext
218 syn keyword cmusrcSBindContext contained common library playlist queue
220 \ nextgroup=cmusrcSBindKey
223 syn match cmusrcSBindKey contained display '\S\+'
225 syn keyword cmusrcKeyword contained toggle
226 \ nextgroup=cmusrcTogglableOpt
229 syn keyword cmusrcTogglableOpt contained auto_reshuffle aaa_mode
230 \ confirm_run continue play_library play_sorted
231 \ repeat show_hidden show_remaining_time shuffle
233 syn keyword cmusrcKeyword contained unbind
234 \ nextgroup=cmusrcUnbindSwitches,
238 syn match cmusrcUnbindSwitches contained display '-[f]'
239 \ nextgroup=cmusrcSBindContext
242 syn keyword cmusrcKeyword contained view
243 \ nextgroup=cmusrcView
246 syn keyword cmusrcView contained library playlist queue browser filters
247 syn match cmusrcView contained display '[1-6]'
249 syn keyword cmusrcKeyword contained vol
250 \ nextgroup=cmusrcVolume1
253 syn match cmusrcVolume1 contained display '[+-]\=\d\+%'
254 \ nextgroup=cmusrcVolume2
257 syn match cmusrcVolume2 contained display '[+-]\=\d\+%'
259 hi def link cmusrcTodo Todo
260 hi def link cmusrcComment Comment
261 hi def link cmusrcKeyword Keyword
262 hi def link cmusrcSwitches Special
263 hi def link cmusrcAddSwitches cmusrcSwitches
264 hi def link cmusrcURI Normal
265 hi def link cmusrcBindSwitches cmusrcSwitches
266 hi def link cmusrcContext Type
267 hi def link cmusrcBindContext cmusrcContext
268 hi def link cmusrcKey String
269 hi def link cmusrcBindKey cmusrcKey
270 hi def link cmusrcDirectory Normal
271 hi def link cmusrcClearSwitches cmusrcSwitches
272 hi def link cmusrcFSetName PreProc
273 hi def link cmusrcEq Normal
274 hi def link cmusrcFSetEq cmusrcEq
275 hi def link cmusrcFilterExpr Normal
276 hi def link cmusrcLoadSwitches cmusrcSwitches
277 hi def link cmusrcSaveSwitches cmusrcSwitches
278 hi def link cmusrcFile Normal
279 hi def link cmusrcSeekOffset Number
280 hi def link cmusrcOption PreProc
281 hi def link cmusrcSetTest Normal
282 hi def link cmusrcOptBoolean Boolean
283 hi def link cmusrcOptEqAAA cmusrcEq
284 hi def link cmusrcOptAAA Identifier
285 hi def link cmusrcOptEqNumber cmusrcEq
286 hi def link cmusrcOptNumber Number
287 hi def link cmusrcOptEqFormat cmusrcEq
288 hi def link cmusrcOptFormat String
289 hi def link cmusrcFormatSpecial SpecialChar
290 hi def link cmusrcOptEqColor cmusrcEq
291 hi def link cmusrcOptColor Normal
292 hi def link cmusrcOptColorName cmusrcOptColor
293 hi def link cmusrcOptColorValue cmusrcOptColor
294 hi def link cmusrcOptEqString cmusrcEq
295 hi def link cmusrcOptString Normal
296 hi def link cmusrcOptEqSortKeys cmusrcEq
297 hi def link cmusrcOptSortKeys Identifier
298 hi def link cmusrcSBindContext cmusrcContext
299 hi def link cmusrcSBindKey cmusrcKey
300 hi def link cmusrcTogglableOpt cmusrcOption
301 hi def link cmusrcUnbindSwitches cmusrcSwitches
302 hi def link cmusrcView Normal
303 hi def link cmusrcVolume1 Number
304 hi def link cmusrcVolume2 Number
306 let b:current_syntax = "cmusrc"
308 let &cpo = s:cpo_save