Hello Bram,

attached is a new syntax highlighting file for vim.
It is used to highlight dnsmasq(8) configuration files.

Please include it i the runtime files.

Thanks.
-- 
bye Thilo

4096R/0xC70B1A8F
721B 1BA0 095C 1ABA 3FC6  7C18 89A4 A2A0 C70B 1A8F

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
" Vim syntax file
" Language:     dnsmasq(8) configuration file
" Maintainer:   Thilo Six <[email protected]>
" Last Change:  2011 Apr 18
" Credits:      This file is a mix of cfg.vim, wget.vim and xf86conf.vim, 
credits go to:
"               Igor N. Prischepoff
"               Doug Kearns
"               David Ne\v{c}as
"
" Options:      let dnsmasq_backrgound_light = 1
"
" 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")
    finish
endif

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 off
syn case ignore

"Parameters
syn match   DnsmasqParams   "^.\{-}="me=e-1 contains=DnsmasqComment
"... and their values (don't want to highlight '=' sign)
syn match   DnsmasqValues   "=.*"hs=s+1 contains=DnsmasqComment,DnsmasqSpecial

"...because we do it here.
syn match   DnsmasqEq       display '=\|@\|/\|,' nextgroup=DnsmasqValues

syn match DnsmasqSpecial    "#"

" String
syn match  DnsmasqString    "\".*\""
syn match  DnsmasqString    "'.*'"

" Comments
syn match  DnsmasqComment   "^#.*$" contains=DnsmasqTodo
syn match  DnsmasqComment   "[ \t]#.*$" contains=DnsmasqTodo
syn case match
syn keyword DnsmasqTodo     FIXME TODO XXX NOT contained

syn match DnsmasqKeyword    "^\s*add\-mac"
syn match DnsmasqKeyword    "^\s*all\-servers"
syn match DnsmasqKeyword    "^\s*bind\-interfaces"
syn match DnsmasqKeyword    "^\s*bogus\-priv"
syn match DnsmasqKeyword    "^\s*clear\-on\-reload"
syn match DnsmasqKeyword    "^\s*dhcp\-authoritative"
syn match DnsmasqKeyword    "^\s*dhcp\-fqdn"
syn match DnsmasqKeyword    "^\s*dhcp\-no\-override"
syn match DnsmasqKeyword    "^\s*dhcp\-scriptuser"
syn match DnsmasqKeyword    "^\s*domain\-needed"
syn match DnsmasqKeyword    "^\s*enable\-dbus"
syn match DnsmasqKeyword    "^\s*enable\-tftp"
syn match DnsmasqKeyword    "^\s*expand\-hosts"
syn match DnsmasqKeyword    "^\s*filterwin2k"
syn match DnsmasqKeyword    "^\s*keep\-in\-foreground"
syn match DnsmasqKeyword    "^\s*leasefile\-ro"
syn match DnsmasqKeyword    "^\s*localise\-queries"
syn match DnsmasqKeyword    "^\s*localmx"
syn match DnsmasqKeyword    "^\s*log\-dhcp"
syn match DnsmasqKeyword    "^\s*log\-queries"
syn match DnsmasqKeyword    "^\s*no\-daemon"
syn match DnsmasqKeyword    "^\s*no\-hosts"
syn match DnsmasqKeyword    "^\s*no\-negcache"
syn match DnsmasqKeyword    "^\s*no\-ping"
syn match DnsmasqKeyword    "^\s*no\-poll"
syn match DnsmasqKeyword    "^\s*no\-resolv"
syn match DnsmasqKeyword    "^\s*proxy\-dnssec"
syn match DnsmasqKeyword    "^\s*read\-ethers"
syn match DnsmasqKeyword    "^\s*rebind\-localhost\-ok"
syn match DnsmasqKeyword    "^\s*selfmx"
syn match DnsmasqKeyword    "^\s*stop\-dns\-rebind"
syn match DnsmasqKeyword    "^\s*strict\-order"
syn match DnsmasqKeyword    "^\s*tftp\-no\-blocksize"
syn match DnsmasqKeyword    "^\s*tftp\-secure"
syn match DnsmasqKeyword    "^\s*tftp\-unique\-root"

" Define the default hightlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_dnsmasq_syn_inits")
    if version < 508
        let did_dnsmasq_syn_inits = 1
        command -nargs=+ HiLink hi link <args>
    else
        command -nargs=+ HiLink hi def link <args>
    endif

    if b:dnsmasq_backrgound_light >= 1
        hi def DnsmasqParams    ctermfg=DarkGreen guifg=DarkGreen
        hi def DnsmasqKeyword   ctermfg=DarkGreen guifg=DarkGreen
    else
        HiLink DnsmasqKeyword   Keyword
        HiLink DnsmasqParams    Keyword
    endif
    HiLink DnsmasqTodo      Todo
    HiLink DnsmasqSpecial   Constant
    HiLink DnsmasqComment   Comment
    HiLink DnsmasqString    Constant
    HiLink DnsmasqValues    Normal
    HiLink DnsmasqEq        Constant

    delcommand HiLink
endif
let b:current_syntax = "dnsmasq"
--- filetype.vim.orig	2011-04-10 08:55:13.000000000 +0200
+++ filetype.vim	2011-04-18 21:20:44.000000000 +0200
@@ -1,7 +1,7 @@
 " Vim support file to detect file types
 "
 " Maintainer:	Bram Moolenaar <[email protected]>
-" Last Change:	2011 Apr 01
+" Last Change:	2011 Apr 18
 
 " Listen very carefully, I will say this only once
 if exists("did_load_filetypes")
@@ -558,6 +558,10 @@
 " Deny hosts
 au BufNewFile,BufRead denyhosts.conf		setf denyhosts
 
+" dnsmasq(8) configuration
+au BufNewFile,BufRead dnsmasq.conf		setf dnsmasq
+au BufNewFile,BufRead */etc/dnsmasq.d/*		call s:StarSetf('dnsmasq')
+
 " ROCKLinux package description
 au BufNewFile,BufRead *.desc			setf desc
 

Raspunde prin e-mail lui