cmusrc.vim 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. " Vim syntax file
  2. " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
  3. " Latest Revision: 2007-06-17
  4. if exists("b:current_syntax")
  5. finish
  6. endif
  7. let s:cpo_save = &cpo
  8. set cpo&vim
  9. setlocal iskeyword+=-
  10. syn keyword cmusrcTodo contained TODO FIXME XXX NOTE
  11. syn match cmusrcComment contained display '^\s*#.*$'
  12. syn match cmusrcBegin display '^'
  13. \ nextgroup=cmusrcKeyword,cmusrcComment
  14. \ skipwhite
  15. syn keyword cmusrcKeyword contained add
  16. \ nextgroup=cmusrcAddSwitches,cmusrcURI
  17. \ skipwhite
  18. syn match cmusrcAddSwitches contained display '-[lpqQ]'
  19. \ nextgroup=cmusrcURI
  20. \ skipwhite
  21. syn match cmusrcURI contained display '.\+'
  22. syn keyword cmusrcKeyword contained bind
  23. \ nextgroup=cmusrcBindSwitches,
  24. \ cmusrcBindContext
  25. \ skipwhite
  26. syn match cmusrcBindSwitches contained display '-[f]'
  27. \ nextgroup=cmusrcBindContext
  28. \ skipwhite
  29. syn keyword cmusrcBindContext contained common library playlist queue
  30. \ browser filters
  31. \ nextgroup=cmusrcBindKey
  32. \ skipwhite
  33. syn match cmusrcBindKey contained display '\S\+'
  34. \ nextgroup=cmusrcKeyword
  35. \ skipwhite
  36. syn keyword cmusrcKeyword contained browser-up colorscheme echo factivate
  37. \ filter invert player-next player-pause
  38. \ player-play player-prev player-stop quit
  39. \ refresh run search-next search-prev shuffle
  40. \ unmark win-activate win-add-l win-add-p
  41. \ win-add-Q win-add-q win-bottom win-down
  42. \ win-mv-after win-mv-before win-next
  43. \ win-page-down win-page-up win-remove
  44. \ win-sel-cur win-toggle win-top win-up
  45. \ win-update
  46. syn keyword cmusrcKeyword contained cd
  47. \ nextgroup=cmusrcDirectory
  48. \ skipwhite
  49. syn match cmusrcDirectory contained display '.\+'
  50. syn keyword cmusrcKeyword contained clear
  51. \ nextgroup=cmusrcClearSwitches
  52. syn match cmusrcClearSwitches contained display '-[lpq]'
  53. syn keyword cmusrcKeyword contained fset
  54. \ nextgroup=cmusrcFSetName
  55. \ skipwhite
  56. syn match cmusrcFSetName contained display '[^=]\+'
  57. \ nextgroup=cmusrcFSetEq
  58. syn match cmusrcFSetEq contained display '='
  59. \ nextgroup=cmusrcFilterExpr
  60. syn match cmusrcFilterExpr contained display '.\+'
  61. syn keyword cmusrcKeyword contained load
  62. \ nextgroup=cmusrcLoadSwitches,cmusrcURI
  63. \ skipwhite
  64. syn match cmusrcLoadSwitches contained display '-[lp]'
  65. \ nextgroup=cmusrcURI
  66. \ skipwhite
  67. syn keyword cmusrcKeyword contained mark
  68. \ nextgroup=cmusrcFilterExpr
  69. syn keyword cmusrcKeyword contained save
  70. \ nextgroup=cmusrcSaveSwitches,cmusrcFile
  71. \ skipwhite
  72. syn match cmusrcSaveSwitches contained display '-[lp]'
  73. \ nextgroup=cmusrcFile
  74. \ skipwhite
  75. syn match cmusrcFile contained display '.\+'
  76. syn keyword cmusrcKeyword contained seek
  77. \ nextgroup=cmusrcSeekOffset
  78. \ skipwhite
  79. syn match cmusrcSeekOffset contained display
  80. \ '[+-]\=\%(\d\+[mh]\=\|\%(\%(0\=\d\|[1-5]\d\):\)\=\%(0\=\d\|[1-5]\d\):\%(0\=\d\|[1-5]\d\)\)'
  81. syn keyword cmusrcKeyword contained set
  82. \ nextgroup=cmusrcOption
  83. \ skipwhite
  84. syn keyword cmusrcOption contained auto_reshuffle confirm_run
  85. \ continue play_library play_sorted repeat
  86. \ show_hidden show_remaining_time shuffle
  87. \ nextgroup=cmusrcSetTest,cmusrcOptEqBoolean
  88. syn match cmusrcSetTest contained display '?'
  89. syn match cmusrcOptEqBoolean contained display '='
  90. \ nextgroup=cmusrcOptBoolean
  91. syn keyword cmusrcOptBoolean contained true false
  92. syn keyword cmusrcOption contained aaa_mode
  93. \ nextgroup=cmusrcOptEqAAA
  94. syn match cmusrcOptEqAAA contained display '='
  95. \ nextgroup=cmusrcOptAAA
  96. syn keyword cmusrcOptAAA contained all artist album
  97. syn keyword cmusrcOption contained buffer_seconds
  98. \ nextgroup=cmusrcOptEqNumber
  99. syn match cmusrcOptEqNumber contained display '='
  100. \ nextgroup=cmusrcOptNumber
  101. syn match cmusrcOptNumber contained display '\d\+'
  102. syn keyword cmusrcOption contained altformat_current altformat_playlist
  103. \ altformat_title altformat_trackwin
  104. \ format_current format_playlist format_title
  105. \ format_trackwin
  106. \ nextgroup=cmusrcOptEqFormat
  107. syn match cmusrcOptEqFormat contained display '='
  108. \ nextgroup=cmusrcOptFormat
  109. syn match cmusrcOptFormat contained display '.\+'
  110. \ contains=cmusrcFormatSpecial
  111. syn match cmusrcFormatSpecial contained display '%[0-]*\d*[alDntgydfF=%]'
  112. syn keyword cmusrcOption contained color_cmdline_bg color_cmdline_fg
  113. \ color_error color_info color_separator
  114. \ color_statusline_bg color_statusline_fg
  115. \ color_titleline_bg color_titleline_fg
  116. \ color_win_bg color_win_cur
  117. \ color_win_cur_sel_bg color_win_cur_sel_fg
  118. \ color_win_dir color_win_fg
  119. \ color_win_inactive_cur_sel_bg
  120. \ color_win_inactive_cur_sel_fg
  121. \ color_win_inactive_sel_bg
  122. \ color_win_inactive_sel_fg
  123. \ color_win_sel_bg color_win_sel_fg
  124. \ color_win_title_bg color_win_title_fg
  125. \ nextgroup=cmusrcOptEqColor
  126. syn match cmusrcOptEqColor contained display '='
  127. \ nextgroup=@cmusrcOptColor
  128. syn cluster cmusrcOptColor contains=cmusrcOptColorName,cmusrcOptColorValue
  129. syn keyword cmusrcOptColorName contained default black red green yellow blue
  130. \ magenta cyan gray darkgray lightred lightred
  131. \ lightgreen lightyellow lightblue lightmagenta
  132. \ lightcyan white
  133. syn match cmusrcOptColorValue contained display
  134. \ '-1\|0*\%(\d\|[1-9]\d\|1\d\d\|2\%([0-4]\d\|5[0-5]\)\)'
  135. syn keyword cmusrcOption contained id3_default_charset output_plugin
  136. \ status_display_program
  137. \ nextgroup=cmusrcOptEqString
  138. syn match cmusrcOption contained
  139. \ '\%(dsp\|mixer\)\.\%(alsa\|oss\|sun\)\.\%(channel\|device\)'
  140. \ nextgroup=cmusrcOptEqString
  141. syn match cmusrcOption contained
  142. \ 'dsp\.ao\.\%(buffer_size\|driver\|wav_counter\|wav_dir\)'
  143. \ nextgroup=cmusrcOptEqString
  144. syn match cmusrcOptEqString contained display '='
  145. \ nextgroup=cmusrcOptString
  146. syn match cmusrcOptString contained display '.\+'
  147. syn keyword cmusrcOption contained lib_sort pl_sort
  148. \ nextgroup=cmusrcOptEqSortKeys
  149. syn match cmusrcOptEqSortKeys contained display '='
  150. \ nextgroup=cmusrcOptSortKeys
  151. syn keyword cmusrcOptSortKeys contained artist album title tracknumber
  152. \ discnumber date genre filename
  153. \ nextgroup=cmusrcOptSortKeys
  154. \ skipwhite
  155. syn keyword cmusrcKeyword contained showbind
  156. \ nextgroup=cmusrcSBindContext
  157. \ skipwhite
  158. syn keyword cmusrcSBindContext contained common library playlist queue
  159. \ browser filters
  160. \ nextgroup=cmusrcSBindKey
  161. \ skipwhite
  162. syn match cmusrcSBindKey contained display '\S\+'
  163. syn keyword cmusrcKeyword contained toggle
  164. \ nextgroup=cmusrcTogglableOpt
  165. \ skipwhite
  166. syn keyword cmusrcTogglableOpt contained auto_reshuffle aaa_mode
  167. \ confirm_run continue play_library play_sorted
  168. \ repeat show_hidden show_remaining_time shuffle
  169. syn keyword cmusrcKeyword contained unbind
  170. \ nextgroup=cmusrcUnbindSwitches,
  171. \ cmusrcSBindContext
  172. \ skipwhite
  173. syn match cmusrcUnbindSwitches contained display '-[f]'
  174. \ nextgroup=cmusrcSBindContext
  175. \ skipwhite
  176. syn keyword cmusrcKeyword contained view
  177. \ nextgroup=cmusrcView
  178. \ skipwhite
  179. syn keyword cmusrcView contained library playlist queue browser filters
  180. syn match cmusrcView contained display '[1-6]'
  181. syn keyword cmusrcKeyword contained vol
  182. \ nextgroup=cmusrcVolume1
  183. \ skipwhite
  184. syn match cmusrcVolume1 contained display '[+-]\=\d\+%'
  185. \ nextgroup=cmusrcVolume2
  186. \ skipwhite
  187. syn match cmusrcVolume2 contained display '[+-]\=\d\+%'
  188. hi def link cmusrcTodo Todo
  189. hi def link cmusrcComment Comment
  190. hi def link cmusrcKeyword Keyword
  191. hi def link cmusrcSwitches Special
  192. hi def link cmusrcAddSwitches cmusrcSwitches
  193. hi def link cmusrcURI Normal
  194. hi def link cmusrcBindSwitches cmusrcSwitches
  195. hi def link cmusrcContext Type
  196. hi def link cmusrcBindContext cmusrcContext
  197. hi def link cmusrcKey String
  198. hi def link cmusrcBindKey cmusrcKey
  199. hi def link cmusrcDirectory Normal
  200. hi def link cmusrcClearSwitches cmusrcSwitches
  201. hi def link cmusrcFSetName PreProc
  202. hi def link cmusrcEq Normal
  203. hi def link cmusrcFSetEq cmusrcEq
  204. hi def link cmusrcFilterExpr Normal
  205. hi def link cmusrcLoadSwitches cmusrcSwitches
  206. hi def link cmusrcSaveSwitches cmusrcSwitches
  207. hi def link cmusrcFile Normal
  208. hi def link cmusrcSeekOffset Number
  209. hi def link cmusrcOption PreProc
  210. hi def link cmusrcSetTest Normal
  211. hi def link cmusrcOptBoolean Boolean
  212. hi def link cmusrcOptEqAAA cmusrcEq
  213. hi def link cmusrcOptAAA Identifier
  214. hi def link cmusrcOptEqNumber cmusrcEq
  215. hi def link cmusrcOptNumber Number
  216. hi def link cmusrcOptEqFormat cmusrcEq
  217. hi def link cmusrcOptFormat String
  218. hi def link cmusrcFormatSpecial SpecialChar
  219. hi def link cmusrcOptEqColor cmusrcEq
  220. hi def link cmusrcOptColor Normal
  221. hi def link cmusrcOptColorName cmusrcOptColor
  222. hi def link cmusrcOptColorValue cmusrcOptColor
  223. hi def link cmusrcOptEqString cmusrcEq
  224. hi def link cmusrcOptString Normal
  225. hi def link cmusrcOptEqSortKeys cmusrcEq
  226. hi def link cmusrcOptSortKeys Identifier
  227. hi def link cmusrcSBindContext cmusrcContext
  228. hi def link cmusrcSBindKey cmusrcKey
  229. hi def link cmusrcTogglableOpt cmusrcOption
  230. hi def link cmusrcUnbindSwitches cmusrcSwitches
  231. hi def link cmusrcView Normal
  232. hi def link cmusrcVolume1 Number
  233. hi def link cmusrcVolume2 Number
  234. let b:current_syntax = "cmusrc"
  235. let &cpo = s:cpo_save
  236. unlet s:cpo_save