neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

dnsmasq.vim (10067B)


      1 " Vim syntax file
      2 " Maintainer:	Thilo Six
      3 " Contact:	vim-foo@xk2c-foo.de
      4 "		:3s+-foo++g
      5 " Description:	highlight dnsmasq configuration files
      6 " File:		runtime/syntax/dnsmasq.vim
      7 " Version:	2.76
      8 " Last Change:	2015 Sep 27
      9 " Modeline:	vim: ts=8:sw=2:sts=2:
     10 "
     11 " License:	VIM License
     12 "		Vim is Charityware, see ":help Uganda"
     13 "
     14 " Options:	You might want to add this to your vimrc:
     15 "
     16 "		if &background == "dark"
     17 "		    let dnsmasq_backrgound_light = 0
     18 "		else
     19 "		    let dnsmasq_backrgound_light = 1
     20 "		endif
     21 "
     22 
     23 " quit when a syntax file was already loaded
     24 if exists("b:current_syntax") || &compatible
     25    finish
     26 endif
     27 
     28 let s:cpo_save = &cpo
     29 set cpo&vim
     30 
     31 if !exists("b:dnsmasq_backrgound_light")
     32    if exists("dnsmasq_backrgound_light")
     33 let b:dnsmasq_backrgound_light = dnsmasq_backrgound_light
     34    else
     35 let b:dnsmasq_backrgound_light = 0
     36    endif
     37 endif
     38 
     39 
     40 " case on
     41 syn case match
     42 
     43 syn match   DnsmasqValues   "=.*"hs=s+1 contains=DnsmasqComment,DnsmasqSpecial
     44 syn match   DnsmasqSpecial  display '=\|@\|,\|!\|:'	  nextgroup=DnsmasqValues
     45 syn match   DnsmasqSpecial  "#"
     46 
     47 syn match   DnsmasqIPv4	    "\<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\>"	nextgroup=DnsmasqSubnet2,DnsmasqRange
     48 syn match   DnsmasqSubnet   "\<255.\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{2\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\>"
     49 syn match   DnsmasqSubnet2  contained "\/\([0-4]\?[0-9]\)\>"
     50 syn match   DnsmasqRange    contained "-"
     51 syn match   DnsmasqMac	    "\<\(\x\x\?:\)\{5}\x\x\?"
     52 
     53 syn match   DnsmasqTime	    "\<\(\d\{1,3}\)[hm]\>"
     54 
     55 " String
     56 syn match   DnsmasqString   "\".*\""  contains=@Spell
     57 syn match   DnsmasqString   "'.*'"    contains=@Spell
     58 
     59 " Comments
     60 syn keyword DnsmasqTodo	    FIXME TODO XXX NOTE contained
     61 syn match   DnsmasqComment  "\(^\|\s\+\)#.*$"   contains=@Spell,DnsmasqTodo
     62 
     63 " highlight trailing spaces
     64 syn match   DnsmasqTrailSpace	   "[ \t]\+$"
     65 syn match   DnsmasqTrailSpace	   "[ \t]\+$" containedin=ALL
     66 
     67 syn match DnsmasqKeywordSpecial    "\<set\>:"me=e-1
     68 syn match DnsmasqKeywordSpecial    "\<tag\>:"me=e-1
     69 syn match DnsmasqKeywordSpecial    ",\<static\>"hs=s+1	  contains=DnsmasqSpecial
     70 syn match DnsmasqKeywordSpecial    ",\<infinite\>"hs=s+1  contains=DnsmasqSpecial
     71 syn match DnsmasqKeywordSpecial    "\<encap\>:"me=e-1
     72 syn match DnsmasqKeywordSpecial    "\<interface\>:"me=e-1
     73 syn match DnsmasqKeywordSpecial    "\<vi-encap\>:"me=e-1
     74 syn match DnsmasqKeywordSpecial    "\<net\>:"me=e-1
     75 syn match DnsmasqKeywordSpecial    "\<vendor\>:"me=e-1
     76 syn match DnsmasqKeywordSpecial    "\<opt\>:"me=e-1
     77 syn match DnsmasqKeywordSpecial    "\<option\>:"me=e-1
     78 syn match DnsmasqKeywordSpecial    ",\<ignore\>"hs=s+1	  contains=DnsmasqSpecial
     79 syn match DnsmasqKeywordSpecial    "\<id\>:"me=e-1
     80 
     81 syn match DnsmasqKeyword    "^\s*add-mac\>"
     82 syn match DnsmasqKeyword    "^\s*add-subnet\>"
     83 syn match DnsmasqKeyword    "^\s*addn-hosts\>"
     84 syn match DnsmasqKeyword    "^\s*address\>"
     85 syn match DnsmasqKeyword    "^\s*alias\>"
     86 syn match DnsmasqKeyword    "^\s*all-servers\>"
     87 syn match DnsmasqKeyword    "^\s*auth-zone\>"
     88 syn match DnsmasqKeyword    "^\s*bind-dynamic\>"
     89 syn match DnsmasqKeyword    "^\s*bind-interfaces\>"
     90 syn match DnsmasqKeyword    "^\s*bogus-nxdomain\>"
     91 syn match DnsmasqKeyword    "^\s*bogus-priv\>"
     92 syn match DnsmasqKeyword    "^\s*bootp-dynamic\>"
     93 syn match DnsmasqKeyword    "^\s*bridge-interface\>"
     94 syn match DnsmasqKeyword    "^\s*cache-size\>"
     95 syn match DnsmasqKeyword    "^\s*clear-on-reload\>"
     96 syn match DnsmasqKeyword    "^\s*cname\>"
     97 syn match DnsmasqKeyword    "^\s*conf-dir\>"
     98 syn match DnsmasqKeyword    "^\s*conf-file\>"
     99 syn match DnsmasqKeyword    "^\s*conntrack\>"
    100 syn match DnsmasqKeyword    "^\s*dhcp-alternate-port\>"
    101 syn match DnsmasqKeyword    "^\s*dhcp-authoritative\>"
    102 syn match DnsmasqKeyword    "^\s*dhcp-boot\>"
    103 syn match DnsmasqKeyword    "^\s*dhcp-broadcast\>"
    104 syn match DnsmasqKeyword    "^\s*dhcp-circuitid\>"
    105 syn match DnsmasqKeyword    "^\s*dhcp-client-update\>"
    106 syn match DnsmasqKeyword    "^\s*dhcp-duid\>"
    107 syn match DnsmasqKeyword    "^\s*dhcp-fqdn\>"
    108 syn match DnsmasqKeyword    "^\s*dhcp-generate-names\>"
    109 syn match DnsmasqKeyword    "^\s*dhcp-host\>"
    110 syn match DnsmasqKeyword    "^\s*dhcp-hostsfile\>"
    111 syn match DnsmasqKeyword    "^\s*dhcp-ignore\>"
    112 syn match DnsmasqKeyword    "^\s*dhcp-ignore-names\>"
    113 syn match DnsmasqKeyword    "^\s*dhcp-lease-max\>"
    114 syn match DnsmasqKeyword    "^\s*dhcp-leasefile\>"
    115 syn match DnsmasqKeyword    "^\s*dhcp-luascript\>"
    116 syn match DnsmasqKeyword    "^\s*dhcp-mac\>"
    117 syn match DnsmasqKeyword    "^\s*dhcp-match\>"
    118 syn match DnsmasqKeyword    "^\s*dhcp-no-override\>"
    119 syn match DnsmasqKeyword    "^\s*dhcp-option\>"
    120 syn match DnsmasqKeyword    "^\s*dhcp-option-force\>"
    121 syn match DnsmasqKeyword    "^\s*dhcp-optsfile\>"
    122 syn match DnsmasqKeyword    "^\s*dhcp-proxy\>"
    123 syn match DnsmasqKeyword    "^\s*dhcp-range\>"
    124 syn match DnsmasqKeyword    "^\s*dhcp-relay\>"
    125 syn match DnsmasqKeyword    "^\s*dhcp-remoteid\>"
    126 syn match DnsmasqKeyword    "^\s*dhcp-script\>"
    127 syn match DnsmasqKeyword    "^\s*dhcp-scriptuser\>"
    128 syn match DnsmasqKeyword    "^\s*dhcp-sequential-ip\>"
    129 syn match DnsmasqKeyword    "^\s*dhcp-subscrid\>"
    130 syn match DnsmasqKeyword    "^\s*dhcp-userclass\>"
    131 syn match DnsmasqKeyword    "^\s*dhcp-vendorclass\>"
    132 syn match DnsmasqKeyword    "^\s*dhcp-hostsdir\>"
    133 syn match DnsmasqKeyword    "^\s*dns-rr\>"
    134 syn match DnsmasqKeyword    "^\s*dnssec\>"
    135 syn match DnsmasqKeyword    "^\s*dnssec-check-unsigned\>"
    136 syn match DnsmasqKeyword    "^\s*dnssec-no-timecheck\>"
    137 syn match DnsmasqKeyword    "^\s*dnssec-timestamp\>"
    138 syn match DnsmasqKeyword    "^\s*dns-forward-max\>"
    139 syn match DnsmasqKeyword    "^\s*domain\>"
    140 syn match DnsmasqKeyword    "^\s*domain-needed\>"
    141 syn match DnsmasqKeyword    "^\s*edns-packet-max\>"
    142 syn match DnsmasqKeyword    "^\s*enable-dbus\>"
    143 syn match DnsmasqKeyword    "^\s*enable-ra\>"
    144 syn match DnsmasqKeyword    "^\s*enable-tftp\>"
    145 syn match DnsmasqKeyword    "^\s*except-interface\>"
    146 syn match DnsmasqKeyword    "^\s*expand-hosts\>"
    147 syn match DnsmasqKeyword    "^\s*filterwin2k\>"
    148 syn match DnsmasqKeyword    "^\s*group\>"
    149 syn match DnsmasqKeyword    "^\s*host-record\>"
    150 syn match DnsmasqKeyword    "^\s*interface\>"
    151 syn match DnsmasqKeyword    "^\s*interface-name\>"
    152 syn match DnsmasqKeyword    "^\s*ipset\>"
    153 syn match DnsmasqKeyword    "^\s*ignore-address\>"
    154 syn match DnsmasqKeyword    "^\s*keep-in-foreground\>"
    155 syn match DnsmasqKeyword    "^\s*leasefile-ro\>"
    156 syn match DnsmasqKeyword    "^\s*listen-address\>"
    157 syn match DnsmasqKeyword    "^\s*local\>"
    158 syn match DnsmasqKeyword    "^\s*localmx\>"
    159 syn match DnsmasqKeyword    "^\s*local-ttl\>"
    160 syn match DnsmasqKeyword    "^\s*local-service\>"
    161 syn match DnsmasqKeyword    "^\s*localise-queries\>"
    162 syn match DnsmasqKeyword    "^\s*log-async\>"
    163 syn match DnsmasqKeyword    "^\s*log-dhcp\>"
    164 syn match DnsmasqKeyword    "^\s*log-facility\>"
    165 syn match DnsmasqKeyword    "^\s*log-queries\>"
    166 syn match DnsmasqKeyword    "^\s*max-ttl\>"
    167 syn match DnsmasqKeyword    "^\s*max-cache-ttl\>"
    168 syn match DnsmasqKeyword    "^\s*min-cache-ttl\>"
    169 syn match DnsmasqKeyword    "^\s*min-port\>"
    170 syn match DnsmasqKeyword    "^\s*mx-host\>"
    171 syn match DnsmasqKeyword    "^\s*mx-target\>"
    172 syn match DnsmasqKeyword    "^\s*naptr-record\>"
    173 syn match DnsmasqKeyword    "^\s*neg-ttl\>"
    174 syn match DnsmasqKeyword    "^\s*no-daemon\>"
    175 syn match DnsmasqKeyword    "^\s*no-dhcp-interface\>"
    176 syn match DnsmasqKeyword    "^\s*no-hosts\>"
    177 syn match DnsmasqKeyword    "^\s*no-negcache\>"
    178 syn match DnsmasqKeyword    "^\s*no-ping\>"
    179 syn match DnsmasqKeyword    "^\s*no-poll\>"
    180 syn match DnsmasqKeyword    "^\s*no-resolv\>"
    181 syn match DnsmasqKeyword    "^\s*pid-file\>"
    182 syn match DnsmasqKeyword    "^\s*port\>"
    183 syn match DnsmasqKeyword    "^\s*proxy-dnssec\>"
    184 syn match DnsmasqKeyword    "^\s*ptr-record\>"
    185 syn match DnsmasqKeyword    "^\s*pxe-prompt\>"
    186 syn match DnsmasqKeyword    "^\s*pxe-service\>"
    187 syn match DnsmasqKeyword    "^\s*query-port\>"
    188 syn match DnsmasqKeyword    "^\s*quiet-ra\>"
    189 syn match DnsmasqKeyword    "^\s*quiet-dhcp\>"
    190 syn match DnsmasqKeyword    "^\s*quiet-dhcp6\>"
    191 syn match DnsmasqKeyword    "^\s*ra-param\>"
    192 syn match DnsmasqKeyword    "^\s*read-ethers\>"
    193 syn match DnsmasqKeyword    "^\s*rebind-domain-ok\>"
    194 syn match DnsmasqKeyword    "^\s*rebind-localhost-ok\>"
    195 syn match DnsmasqKeyword    "^\s*resolv-file\>"
    196 syn match DnsmasqKeyword    "^\s*rev-server\>"
    197 syn match DnsmasqKeyword    "^\s*selfmx\>"
    198 syn match DnsmasqKeyword    "^\s*server\>"
    199 syn match DnsmasqKeyword    "^\s*servers-file\>"
    200 syn match DnsmasqKeyword    "^\s*srv-host\>"
    201 syn match DnsmasqKeyword    "^\s*stop-dns-rebind\>"
    202 syn match DnsmasqKeyword    "^\s*strict-order\>"
    203 syn match DnsmasqKeyword    "^\s*synth-domain\>"
    204 syn match DnsmasqKeyword    "^\s*tag-if\>"
    205 syn match DnsmasqKeyword    "^\s*test\>"
    206 syn match DnsmasqKeyword    "^\s*tftp-max\>"
    207 syn match DnsmasqKeyword    "^\s*tftp-lowercase\>"
    208 syn match DnsmasqKeyword    "^\s*tftp-no-blocksize\>"
    209 syn match DnsmasqKeyword    "^\s*tftp-no-fail\>"
    210 syn match DnsmasqKeyword    "^\s*tftp-port-range\>"
    211 syn match DnsmasqKeyword    "^\s*tftp-root\>"
    212 syn match DnsmasqKeyword    "^\s*tftp-secure\>"
    213 syn match DnsmasqKeyword    "^\s*tftp-unique-root\>"
    214 syn match DnsmasqKeyword    "^\s*txt-record\>"
    215 syn match DnsmasqKeyword    "^\s*user\>"
    216 syn match DnsmasqKeyword    "^\s*version\>"
    217 
    218 
    219 if b:dnsmasq_backrgound_light == 1
    220    hi def DnsmasqKeyword	ctermfg=DarkGreen guifg=DarkGreen
    221 else
    222    hi def link DnsmasqKeyword  Keyword
    223 endif
    224 hi def link DnsmasqKeywordSpecial Type
    225 hi def link DnsmasqTodo		Todo
    226 hi def link DnsmasqSpecial	Constant
    227 hi def link DnsmasqIPv4		Identifier
    228 hi def link DnsmasqSubnet2	DnsmasqSubnet
    229 hi def link DnsmasqSubnet	DnsmasqMac
    230 hi def link DnsmasqRange	DnsmasqMac
    231 hi def link DnsmasqMac		Preproc
    232 hi def link DnsmasqTime		Preproc
    233 hi def link DnsmasqComment	Comment
    234 hi def link DnsmasqTrailSpace	DiffDelete
    235 hi def link DnsmasqString	Constant
    236 hi def link DnsmasqValues	Normal
    237 
    238 let b:current_syntax = "dnsmasq"
    239 
    240 let &cpo = s:cpo_save
    241 unlet s:cpo_save