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