" Vim syntax file
" Maintainer: Thilo Six
" Contact:
" http://www.vim.org/maillist.php#vim-dev
"
" Description: highlight dnsmasq configuration files
" File: runtime/syntax/dnsmasq.vim
" Version: 2.61-1
" Last Change: 2012 May 19
" Modeline: vim: ts=8:sw=2:sts=2:
"
" Credits: Igor N. Prischepoff
" Doug Kearns
" David Ne\v{c}as
" Christian Brabandt
"
" License: VIM License
" Vim is Charityware, see ":help Uganda"
"
" Options: You might want to add this to your vimrc:
"
" if &background == "dark"
" " dnsmasq.vim
" let dnsmasq_backrgound_light = 0
" else
" let dnsmasq_backrgound_light = 1
" endif
"
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax") || &compatible
finish
endif
let s:cpo_save = &cpo
set cpo&vim
if !exists("b:dnsmasq_backrgound_light")
if exists("dnsmasq_backrgound_light")
let b:dnsmasq_backrgound_light = dnsmasq_backrgound_light
else
let b:dnsmasq_backrgound_light = 0
endif
endif
" case on
syn case match
syn match DnsmasqValues "=.*"hs=s+1 contains=DnsmasqComment,DnsmasqSpecial
syn match DnsmasqSpecial display '=\|@\|,\|!\|:' nextgroup=DnsmasqValues
syn match DnsmasqSpecial "#"
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
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]\?\)\>"
syn match DnsmasqSubnet2 contained "\/\([0-4]\?[0-9]\)\>"
syn match DnsmasqRange contained "-"
syn match DnsmasqMac "\<\(\x\x\?:\)\{5}\x\x\?"
syn match DnsmasqTime "\<\(\d\{1,3}\)[hm]\>"
" String
syn match DnsmasqString "\".*\"" contains=@Spell
syn match DnsmasqString "'.*'" contains=@Spell
" Comments
syn keyword DnsmasqTodo FIXME TODO XXX NOTE contained
syn match DnsmasqComment "\(^\|\s\+\)#.*$" contains=@Spell,DnsmasqTodo
" highlight trailing spaces
syn match DnsmasqTrailSpace "[ \t]\+$"
syn match DnsmasqTrailSpace "[ \t]\+$" containedin=ALL
syn match DnsmasqKeywordSpecial "\:"me=e-1
syn match DnsmasqKeywordSpecial "\:"me=e-1
syn match DnsmasqKeywordSpecial ",\"hs=s+1 contains=DnsmasqSpecial
syn match DnsmasqKeywordSpecial ",\"hs=s+1 contains=DnsmasqSpecial
syn match DnsmasqKeywordSpecial "\:"me=e-1
syn match DnsmasqKeywordSpecial "\:"me=e-1
syn match DnsmasqKeywordSpecial "\:"me=e-1
syn match DnsmasqKeywordSpecial "\:"me=e-1
syn match DnsmasqKeywordSpecial "\:"me=e-1
syn match DnsmasqKeywordSpecial "\:"me=e-1
syn match DnsmasqKeywordSpecial "\