blob: e6976201f1d314a15171fdd7133328f442ff9e71 [file] [log] [blame]
Bram Moolenaar8e5af3e2011-04-28 19:02:44 +02001" Vim syntax file
2" Language: dnsmasq(8) configuration file
3" Maintainer: Thilo Six <T.Six@gmx.de>
4" Last Change: 2011 Apr 28
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"
10" Options: let dnsmasq_backrgound_light = 1
11"
12
13" For version 5.x: Clear all syntax items
14" For version 6.x: Quit when a syntax file was already loaded
15if version < 600
16 syntax clear
17elseif exists ("b:current_syntax")
18 finish
19endif
20
21if !exists("b:dnsmasq_backrgound_light")
22 if exists("dnsmasq_backrgound_light")
23 let b:dnsmasq_backrgound_light = dnsmasq_backrgound_light
24 else
25 let b:dnsmasq_backrgound_light = 0
26 endif
27endif
28
29
30" case on
31syn case match
32
33"Parameters
34syn match DnsmasqParams "^.\{-}="me=e-1 contains=DnsmasqComment
35"... and their values (don't want to highlight '=' sign)
36syn match DnsmasqValues "=.*"hs=s+1 contains=DnsmasqComment,DnsmasqSpecial
37
38"...because we do it here.
39syn match DnsmasqEq display '=\|@\|/\|,' nextgroup=DnsmasqValues
40
41syn match DnsmasqSpecial "#"
42
43" String
44syn match DnsmasqString "\".*\""
45syn match DnsmasqString "'.*'"
46
47" Comments
48syn match DnsmasqComment "^#.*$" contains=DnsmasqTodo
49syn match DnsmasqComment "[ \t]#.*$" contains=DnsmasqTodo
50
51syn keyword DnsmasqTodo FIXME TODO XXX NOT contained
52
53syn match DnsmasqKeyword "^\s*add-mac\>"
54syn match DnsmasqKeyword "^\s*all-servers\>"
55syn match DnsmasqKeyword "^\s*bind-interfaces\>"
56syn match DnsmasqKeyword "^\s*bogus-priv\>"
57syn match DnsmasqKeyword "^\s*clear-on-reload\>"
58syn match DnsmasqKeyword "^\s*dhcp-authoritative\>"
59syn match DnsmasqKeyword "^\s*dhcp-fqdn\>"
60syn match DnsmasqKeyword "^\s*dhcp-no-override\>"
61syn match DnsmasqKeyword "^\s*dhcp-scriptuser\>"
62syn match DnsmasqKeyword "^\s*domain-needed\>"
63syn match DnsmasqKeyword "^\s*enable-dbus\>"
64syn match DnsmasqKeyword "^\s*enable-tftp\>"
65syn match DnsmasqKeyword "^\s*expand-hosts\>"
66syn match DnsmasqKeyword "^\s*filterwin2k\>"
67syn match DnsmasqKeyword "^\s*keep-in-foreground\>"
68syn match DnsmasqKeyword "^\s*leasefile-ro\>"
69syn match DnsmasqKeyword "^\s*localise-queries\>"
70syn match DnsmasqKeyword "^\s*localmx\>"
71syn match DnsmasqKeyword "^\s*log-dhcp\>"
72syn match DnsmasqKeyword "^\s*log-queries\>"
73syn match DnsmasqKeyword "^\s*no-daemon\>"
74syn match DnsmasqKeyword "^\s*no-hosts\>"
75syn match DnsmasqKeyword "^\s*no-negcache\>"
76syn match DnsmasqKeyword "^\s*no-ping\>"
77syn match DnsmasqKeyword "^\s*no-poll\>"
78syn match DnsmasqKeyword "^\s*no-resolv\>"
79syn match DnsmasqKeyword "^\s*proxy-dnssec\>"
80syn match DnsmasqKeyword "^\s*read-ethers\>"
81syn match DnsmasqKeyword "^\s*rebind-localhost-ok\>"
82syn match DnsmasqKeyword "^\s*selfmx\>"
83syn match DnsmasqKeyword "^\s*stop-dns-rebind\>"
84syn match DnsmasqKeyword "^\s*strict-order\>"
85syn match DnsmasqKeyword "^\s*tftp-no-blocksize\>"
86syn match DnsmasqKeyword "^\s*tftp-secure\>"
87syn match DnsmasqKeyword "^\s*tftp-unique-root\>"
88
89
90if b:dnsmasq_backrgound_light == 1
91 hi def DnsmasqParams ctermfg=DarkGreen guifg=DarkGreen
92 hi def DnsmasqKeyword ctermfg=DarkGreen guifg=DarkGreen
93else
94 hi def link DnsmasqKeyword Keyword
95 hi def link DnsmasqParams Keyword
96endif
97hi def link DnsmasqTodo Todo
98hi def link DnsmasqSpecial Constant
99hi def link DnsmasqComment Comment
100hi def link DnsmasqString Constant
101hi def link DnsmasqValues Normal
102hi def link DnsmasqEq Constant
103
104let b:current_syntax = "dnsmasq"