Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: dnsmasq(8) configuration file |
| 3 | " Maintainer: Thilo Six <T.Six@gmx.de> |
Bram Moolenaar | 9729301 | 2011-07-18 19:40:27 +0200 | [diff] [blame] | 4 | " Last Change: 2011 Jul 14 |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 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 | " |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 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 |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 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 | |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 28 | |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 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 | |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 41 | syn match DnsmasqValues "=.*"hs=s+1 contains=DnsmasqComment,DnsmasqSpecial |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 42 | syn match DnsmasqSpecial display '=\|@\|,\|!\|:' nextgroup=DnsmasqValues |
| 43 | syn match DnsmasqSpecial "#" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 44 | |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 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\?" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 50 | |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 51 | syn match DnsmasqTime "\<\(\d\{1,3}\)[hm]\>" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 52 | |
| 53 | " String |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 54 | syn match DnsmasqString "\".*\"" |
| 55 | syn match DnsmasqString "'.*'" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 56 | |
| 57 | " Comments |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 58 | syn match DnsmasqComment "^#.*$" contains=DnsmasqTodo |
| 59 | syn match DnsmasqComment "\s#.*$" contains=DnsmasqTodo |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 60 | |
Bram Moolenaar | 9729301 | 2011-07-18 19:40:27 +0200 | [diff] [blame] | 61 | syn keyword DnsmasqTodo FIXME TODO XXX NOTE contained |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 62 | |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 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 | |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 74 | syn match DnsmasqKeyword "^\s*add-mac\>" |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 75 | syn match DnsmasqKeyword "^\s*addn-hosts\>" |
| 76 | syn match DnsmasqKeyword "^\s*address\>" |
| 77 | syn match DnsmasqKeyword "^\s*alias\>" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 78 | syn match DnsmasqKeyword "^\s*all-servers\>" |
| 79 | syn match DnsmasqKeyword "^\s*bind-interfaces\>" |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 80 | syn match DnsmasqKeyword "^\s*bogus-nxdomain\>" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 81 | syn match DnsmasqKeyword "^\s*bogus-priv\>" |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 82 | syn match DnsmasqKeyword "^\s*cache-size\>" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 83 | syn match DnsmasqKeyword "^\s*clear-on-reload\>" |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 84 | syn match DnsmasqKeyword "^\s*cname\>" |
| 85 | syn match DnsmasqKeyword "^\s*conf-dir\>" |
| 86 | syn match DnsmasqKeyword "^\s*conf-file\>" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 87 | syn match DnsmasqKeyword "^\s*dhcp-authoritative\>" |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 88 | syn match DnsmasqKeyword "^\s*dhcp-boot\>" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 89 | syn match DnsmasqKeyword "^\s*dhcp-fqdn\>" |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 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\>" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 96 | syn match DnsmasqKeyword "^\s*dhcp-no-override\>" |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 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\>" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 101 | syn match DnsmasqKeyword "^\s*dhcp-scriptuser\>" |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 102 | syn match DnsmasqKeyword "^\s*dhcp-userclass\>" |
| 103 | syn match DnsmasqKeyword "^\s*dhcp-vendorclass\>" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 104 | syn match DnsmasqKeyword "^\s*domain-needed\>" |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 105 | syn match DnsmasqKeyword "^\s*domain\>" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 106 | syn match DnsmasqKeyword "^\s*enable-dbus\>" |
| 107 | syn match DnsmasqKeyword "^\s*enable-tftp\>" |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 108 | syn match DnsmasqKeyword "^\s*except-interface\>" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 109 | syn match DnsmasqKeyword "^\s*expand-hosts\>" |
| 110 | syn match DnsmasqKeyword "^\s*filterwin2k\>" |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 111 | syn match DnsmasqKeyword "^\s*group\>" |
| 112 | syn match DnsmasqKeyword "^\s*interface\>" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 113 | syn match DnsmasqKeyword "^\s*keep-in-foreground\>" |
| 114 | syn match DnsmasqKeyword "^\s*leasefile-ro\>" |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 115 | syn match DnsmasqKeyword "^\s*listen-address\>" |
| 116 | syn match DnsmasqKeyword "^\s*local-ttl\>" |
| 117 | syn match DnsmasqKeyword "^\s*local\>" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 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\>" |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 122 | syn match DnsmasqKeyword "^\s*mx-host\>" |
| 123 | syn match DnsmasqKeyword "^\s*mx-target\>" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 124 | syn match DnsmasqKeyword "^\s*no-daemon\>" |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 125 | syn match DnsmasqKeyword "^\s*no-dhcp-interface\>" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 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\>" |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 132 | syn match DnsmasqKeyword "^\s*ptr-record\>" |
| 133 | syn match DnsmasqKeyword "^\s*pxe-prompt\>" |
| 134 | syn match DnsmasqKeyword "^\s*pxe-service\>" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 135 | syn match DnsmasqKeyword "^\s*read-ethers\>" |
| 136 | syn match DnsmasqKeyword "^\s*rebind-localhost-ok\>" |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 137 | syn match DnsmasqKeyword "^\s*resolv-file\>" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 138 | syn match DnsmasqKeyword "^\s*selfmx\>" |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 139 | syn match DnsmasqKeyword "^\s*server\>" |
| 140 | syn match DnsmasqKeyword "^\s*srv-host\>" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 141 | syn match DnsmasqKeyword "^\s*stop-dns-rebind\>" |
| 142 | syn match DnsmasqKeyword "^\s*strict-order\>" |
| 143 | syn match DnsmasqKeyword "^\s*tftp-no-blocksize\>" |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 144 | syn match DnsmasqKeyword "^\s*tftp-root\>" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 145 | syn match DnsmasqKeyword "^\s*tftp-secure\>" |
| 146 | syn match DnsmasqKeyword "^\s*tftp-unique-root\>" |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 147 | syn match DnsmasqKeyword "^\s*txt-record\>" |
| 148 | syn match DnsmasqKeyword "^\s*user\>" |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 149 | |
| 150 | |
| 151 | if b:dnsmasq_backrgound_light == 1 |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 152 | hi def DnsmasqParams ctermfg=DarkGreen guifg=DarkGreen |
| 153 | hi def DnsmasqKeyword ctermfg=DarkGreen guifg=DarkGreen |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 154 | else |
| 155 | hi def link DnsmasqKeyword Keyword |
| 156 | hi def link DnsmasqParams Keyword |
| 157 | endif |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 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 | |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 171 | |
| 172 | let b:current_syntax = "dnsmasq" |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 173 | |