2788
|
1 " Vim syntax file
|
|
2 " Language: dnsmasq(8) configuration file
|
|
3 " Maintainer: Thilo Six <T.Six@gmx.de>
|
2833
|
4 " Last Change: 17 May 2011
|
2788
|
5 " Credits: This file is a mix of cfg.vim, wget.vim and xf86conf.vim, credits go to:
|
|
6 " Igor N. Prischepoff
|
|
7 " Doug Kearns
|
|
8 " David Ne\v{c}as
|
|
9 "
|
2833
|
10 " Options: You might want to add this to your vimrc:
|
|
11 "
|
|
12 " if &background == "dark"
|
|
13 " " dnsmasq.vim
|
|
14 " let dnsmasq_backrgound_light = 0
|
|
15 " else
|
|
16 " let dnsmasq_backrgound_light = 1
|
|
17 " endif
|
2788
|
18 "
|
|
19
|
|
20 " For version 5.x: Clear all syntax items
|
|
21 " For version 6.x: Quit when a syntax file was already loaded
|
|
22 if version < 600
|
|
23 syntax clear
|
|
24 elseif exists ("b:current_syntax")
|
|
25 finish
|
|
26 endif
|
|
27
|
2833
|
28
|
2788
|
29 if !exists("b:dnsmasq_backrgound_light")
|
|
30 if exists("dnsmasq_backrgound_light")
|
|
31 let b:dnsmasq_backrgound_light = dnsmasq_backrgound_light
|
|
32 else
|
|
33 let b:dnsmasq_backrgound_light = 0
|
|
34 endif
|
|
35 endif
|
|
36
|
|
37
|
|
38 " case on
|
|
39 syn case match
|
|
40
|
|
41 syn match DnsmasqValues "=.*"hs=s+1 contains=DnsmasqComment,DnsmasqSpecial
|
2833
|
42 syn match DnsmasqSpecial display '=\|@\|,\|!\|:' nextgroup=DnsmasqValues
|
|
43 syn match DnsmasqSpecial "#"
|
2788
|
44
|
2833
|
45 syn match DnsmasqIPv4 "\(\d\{1,3}\.\)\{3}\d\{1,3}" nextgroup=DnsmasqSubnet2,DnsmasqRange
|
|
46 syn match DnsmasqSubnet "\<255.\(\d\{1,3}\.\)\{2}\d\{1,3}"
|
|
47 syn match DnsmasqSubnet2 contained "\/\(\d\{1,2}\)\>"
|
|
48 syn match DnsmasqRange contained "-"
|
|
49 syn match DnsmasqMac "\<\(\x\x\?:\)\{5}\x\x\?"
|
2788
|
50
|
2833
|
51 syn match DnsmasqTime "\<\(\d\{1,3}\)[hm]\>"
|
2788
|
52
|
|
53 " String
|
2833
|
54 syn match DnsmasqString "\".*\""
|
|
55 syn match DnsmasqString "'.*'"
|
2788
|
56
|
|
57 " Comments
|
2833
|
58 syn match DnsmasqComment "^#.*$" contains=DnsmasqTodo
|
|
59 syn match DnsmasqComment "\s#.*$" contains=DnsmasqTodo
|
2788
|
60
|
|
61 syn keyword DnsmasqTodo FIXME TODO XXX NOT contained
|
|
62
|
2833
|
63 syn match DnsmasqKeywordSpecial "\<set\>:"me=e-1
|
|
64 syn match DnsmasqKeywordSpecial "\<tag\>:"me=e-1
|
|
65 syn match DnsmasqKeywordSpecial ",\<static\>"hs=s+1 contains=DnsmasqSpecial
|
|
66 syn match DnsmasqKeywordSpecial ",\<infinite\>"hs=s+1 contains=DnsmasqSpecial
|
|
67 syn match DnsmasqKeywordSpecial "\<encap\>:"me=e-1
|
|
68 syn match DnsmasqKeywordSpecial "\<net\>:"me=e-1
|
|
69 syn match DnsmasqKeywordSpecial "\<vendor\>:"me=e-1
|
|
70 syn match DnsmasqKeywordSpecial "\<option\>:"me=e-1
|
|
71 syn match DnsmasqKeywordSpecial ",\<ignore\>"hs=s+1 contains=DnsmasqSpecial
|
|
72 syn match DnsmasqKeywordSpecial "\<id\>:"me=e-1
|
|
73
|
2788
|
74 syn match DnsmasqKeyword "^\s*add-mac\>"
|
2833
|
75 syn match DnsmasqKeyword "^\s*addn-hosts\>"
|
|
76 syn match DnsmasqKeyword "^\s*address\>"
|
|
77 syn match DnsmasqKeyword "^\s*alias\>"
|
2788
|
78 syn match DnsmasqKeyword "^\s*all-servers\>"
|
|
79 syn match DnsmasqKeyword "^\s*bind-interfaces\>"
|
2833
|
80 syn match DnsmasqKeyword "^\s*bogus-nxdomain\>"
|
2788
|
81 syn match DnsmasqKeyword "^\s*bogus-priv\>"
|
2833
|
82 syn match DnsmasqKeyword "^\s*cache-size\>"
|
2788
|
83 syn match DnsmasqKeyword "^\s*clear-on-reload\>"
|
2833
|
84 syn match DnsmasqKeyword "^\s*cname\>"
|
|
85 syn match DnsmasqKeyword "^\s*conf-dir\>"
|
|
86 syn match DnsmasqKeyword "^\s*conf-file\>"
|
2788
|
87 syn match DnsmasqKeyword "^\s*dhcp-authoritative\>"
|
2833
|
88 syn match DnsmasqKeyword "^\s*dhcp-boot\>"
|
2788
|
89 syn match DnsmasqKeyword "^\s*dhcp-fqdn\>"
|
2833
|
90 syn match DnsmasqKeyword "^\s*dhcp-host\>"
|
|
91 syn match DnsmasqKeyword "^\s*dhcp-ignore\>"
|
|
92 syn match DnsmasqKeyword "^\s*dhcp-lease-max\>"
|
|
93 syn match DnsmasqKeyword "^\s*dhcp-leasefile\>"
|
|
94 syn match DnsmasqKeyword "^\s*dhcp-mac\>"
|
|
95 syn match DnsmasqKeyword "^\s*dhcp-match\>"
|
2788
|
96 syn match DnsmasqKeyword "^\s*dhcp-no-override\>"
|
2833
|
97 syn match DnsmasqKeyword "^\s*dhcp-option-force\>"
|
|
98 syn match DnsmasqKeyword "^\s*dhcp-option\>"
|
|
99 syn match DnsmasqKeyword "^\s*dhcp-range\>"
|
|
100 syn match DnsmasqKeyword "^\s*dhcp-script\>"
|
2788
|
101 syn match DnsmasqKeyword "^\s*dhcp-scriptuser\>"
|
2833
|
102 syn match DnsmasqKeyword "^\s*dhcp-userclass\>"
|
|
103 syn match DnsmasqKeyword "^\s*dhcp-vendorclass\>"
|
2788
|
104 syn match DnsmasqKeyword "^\s*domain-needed\>"
|
2833
|
105 syn match DnsmasqKeyword "^\s*domain\>"
|
2788
|
106 syn match DnsmasqKeyword "^\s*enable-dbus\>"
|
|
107 syn match DnsmasqKeyword "^\s*enable-tftp\>"
|
2833
|
108 syn match DnsmasqKeyword "^\s*except-interface\>"
|
2788
|
109 syn match DnsmasqKeyword "^\s*expand-hosts\>"
|
|
110 syn match DnsmasqKeyword "^\s*filterwin2k\>"
|
2833
|
111 syn match DnsmasqKeyword "^\s*group\>"
|
|
112 syn match DnsmasqKeyword "^\s*interface\>"
|
2788
|
113 syn match DnsmasqKeyword "^\s*keep-in-foreground\>"
|
|
114 syn match DnsmasqKeyword "^\s*leasefile-ro\>"
|
2833
|
115 syn match DnsmasqKeyword "^\s*listen-address\>"
|
|
116 syn match DnsmasqKeyword "^\s*local-ttl\>"
|
|
117 syn match DnsmasqKeyword "^\s*local\>"
|
2788
|
118 syn match DnsmasqKeyword "^\s*localise-queries\>"
|
|
119 syn match DnsmasqKeyword "^\s*localmx\>"
|
|
120 syn match DnsmasqKeyword "^\s*log-dhcp\>"
|
|
121 syn match DnsmasqKeyword "^\s*log-queries\>"
|
2833
|
122 syn match DnsmasqKeyword "^\s*mx-host\>"
|
|
123 syn match DnsmasqKeyword "^\s*mx-target\>"
|
2788
|
124 syn match DnsmasqKeyword "^\s*no-daemon\>"
|
2833
|
125 syn match DnsmasqKeyword "^\s*no-dhcp-interface\>"
|
2788
|
126 syn match DnsmasqKeyword "^\s*no-hosts\>"
|
|
127 syn match DnsmasqKeyword "^\s*no-negcache\>"
|
|
128 syn match DnsmasqKeyword "^\s*no-ping\>"
|
|
129 syn match DnsmasqKeyword "^\s*no-poll\>"
|
|
130 syn match DnsmasqKeyword "^\s*no-resolv\>"
|
|
131 syn match DnsmasqKeyword "^\s*proxy-dnssec\>"
|
2833
|
132 syn match DnsmasqKeyword "^\s*ptr-record\>"
|
|
133 syn match DnsmasqKeyword "^\s*pxe-prompt\>"
|
|
134 syn match DnsmasqKeyword "^\s*pxe-service\>"
|
2788
|
135 syn match DnsmasqKeyword "^\s*read-ethers\>"
|
|
136 syn match DnsmasqKeyword "^\s*rebind-localhost-ok\>"
|
2833
|
137 syn match DnsmasqKeyword "^\s*resolv-file\>"
|
2788
|
138 syn match DnsmasqKeyword "^\s*selfmx\>"
|
2833
|
139 syn match DnsmasqKeyword "^\s*server\>"
|
|
140 syn match DnsmasqKeyword "^\s*srv-host\>"
|
2788
|
141 syn match DnsmasqKeyword "^\s*stop-dns-rebind\>"
|
|
142 syn match DnsmasqKeyword "^\s*strict-order\>"
|
|
143 syn match DnsmasqKeyword "^\s*tftp-no-blocksize\>"
|
2833
|
144 syn match DnsmasqKeyword "^\s*tftp-root\>"
|
2788
|
145 syn match DnsmasqKeyword "^\s*tftp-secure\>"
|
|
146 syn match DnsmasqKeyword "^\s*tftp-unique-root\>"
|
2833
|
147 syn match DnsmasqKeyword "^\s*txt-record\>"
|
|
148 syn match DnsmasqKeyword "^\s*user\>"
|
2788
|
149
|
|
150
|
|
151 if b:dnsmasq_backrgound_light == 1
|
2833
|
152 hi def DnsmasqParams ctermfg=DarkGreen guifg=DarkGreen
|
|
153 hi def DnsmasqKeyword ctermfg=DarkGreen guifg=DarkGreen
|
2788
|
154 else
|
|
155 hi def link DnsmasqKeyword Keyword
|
|
156 hi def link DnsmasqParams Keyword
|
|
157 endif
|
2833
|
158 hi def link DnsmasqKeywordSpecial Type
|
|
159 hi def link DnsmasqTodo Todo
|
|
160 hi def link DnsmasqSpecial Constant
|
|
161 hi def link DnsmasqIPv4 Identifier
|
|
162 hi def link DnsmasqSubnet2 DnsmasqSubnet
|
|
163 hi def link DnsmasqSubnet DnsmasqMac
|
|
164 hi def link DnsmasqRange DnsmasqMac
|
|
165 hi def link DnsmasqMac Preproc
|
|
166 hi def link DnsmasqTime Preproc
|
|
167 hi def link DnsmasqComment Comment
|
|
168 hi def link DnsmasqString Constant
|
|
169 hi def link DnsmasqValues Normal
|
|
170
|
2788
|
171
|
|
172 let b:current_syntax = "dnsmasq"
|
2833
|
173
|