summaryrefslogtreecommitdiff
path: root/runtime/syntax/alsaconf.vim
blob: 90d03605e9db0aef2d7c379a607d7785bd674365 (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
" Vim syntax file
" Language:	    ALSA configuration file
" Maintainer:	    Nikolai Weibull <source@pcppopper.org>
" URL:		    http://www.pcppopper.org/
" Latest Revision:  2004-09-10
" arch-tag:	    3e06fe53-28d5-44a1-871d-279f22e7aed4

if version < 600
  syntax clear
elseif exists("b:current_syntax")
  finish
endif

" todo
syn keyword alsoconfTodo      contained FIXME TODO XXX NOTE

" comments
syn region  alsaconfComment   matchgroup=alsaconfComment start="#" end="$"
			      \ contains=alsaconfTodo

" special characters
syn match   alsaconfSpecialChar	contained "\\[ntvbrf]"
syn match   alsaconfSpecialChar	contained "\\\o\+"

" strings
syn region  alsaconfString    matchgroup=alsaconfString start=+"+ skip=+\\$+
			      \ end=+"+ end=+$+ contains=alsaconfSpecialChar

" preprocessor special
syn match   alsaconfSpecial   contained "confdir:"

" preprocessor
syn region  alsaconfPreProc   matchgroup=alsaconfPreProc start="<" end=">"
			      \ contains=alsaconfSpecial

" modes
syn match   alsaconfMode      "[+?!-]"

" keywords
syn keyword alsaconfKeyword   card default device errors files func strings
syn keyword alsaconfKeyword   subdevice type vars

" variables
syn match   alsaconfVariables "@\(hooks\|func\|args\)"

" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_alsaconf_syn_inits")
  if version < 508
    let did_dircolors_syn_inits = 1
    command -nargs=+ HiLink hi link <args>
  else
    command -nargs=+ HiLink hi def link <args>
  endif

  HiLink alsoconfTodo	      Todo
  HiLink alsaconfComment      Comment
  HiLink alsaconfSpecialChar  SpecialChar
  HiLink alsaconfString	      String
  HiLink alsaconfSpecial      Special
  HiLink alsaconfPreProc      PreProc
  HiLink alsaconfMode	      Special
  HiLink alsaconfKeyword      Keyword
  HiLink alsaconfVariables    Identifier

  delcommand HiLink
endif

let b:current_syntax = "alsaconf"

" vim: set sts=2 sw=2: