" Vim syntax file " Language: BIND configuration file " Maintainer: Robin H. Johnson " Author: Nick Hibma " Changed: 2010-12-23 " Filenames: named.conf, rndc.conf " Location: http://www.van-laarhoven.org/vim/syntax/named.vim " " Previously maintained by glory hump and updated by Marcin " Dalecki. " " Partially updated for BIND 9.7 (per BIND ARM) by Robin H. Johnson " , after nearly 4 years of no updates from Nick Hibma. " " This file could do with a lot of improvements, so comments are welcome. " Please submit the named.conf (segment) with any comments. " " 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 syn case match if version >= 600 setlocal iskeyword=.,-,48-58,A-Z,a-z,_ else set iskeyword=.,-,48-58,A-Z,a-z,_ endif if version >= 600 syn sync match namedSync grouphere NONE "^(zone|controls|acl|key|masters|view|server|logging|options|trusted-keys|managed-keys|statistics-channels)\>" endif let s:save_cpo = &cpo set cpo-=C " BIND configuration file syn match namedComment "//.*$" syn match namedComment "#.*$" syn region namedComment start="/\*" end="\*/" syn region namedString start=/"/ end=/"/ contained " --- omitted trailing semicolon syn match namedError /[^;{#]$/ " --- top-level keywords syn keyword namedInclude include nextgroup=namedString skipwhite syn keyword namedKeyword acl key masters nextgroup=namedIntIdent skipwhite syn keyword namedKeyword server nextgroup=namedIdentifier skipwhite syn keyword namedKeyword controls nextgroup=namedSection skipwhite syn keyword namedKeyword logging nextgroup=namedLogSection skipwhite syn keyword namedKeyword options nextgroup=namedOptSection skipwhite syn keyword namedKeyword zone nextgroup=namedZoneString skipwhite " TODO: these need better validation syn keyword namedKeyword trusted-keys managed-keys nextgroup=namedIntSection skipwhite " TODO: missing sections: statistics-channels view " --- Identifier: name of following { ... } Section syn match namedIdentifier contained /\k\+/ nextgroup=namedSection skipwhite " --- IntIdent: name of following IntSection syn match namedIntIdent contained /"\=\k\+"\=/ nextgroup=namedIntSection skipwhite " --- Section: { ... } clause syn region namedSection contained start=+{+ end=+};+ contains=namedSection,namedIntKeyword " --- IntSection: section that does not contain other sections syn region namedIntSection contained start=+{+ end=+}+ contains=namedIntKeyword,namedError,namedComment " --- IntKeyword: keywords contained within `{ ... }' sections only " + these keywords are contained within `key' and `acl' sections syn keyword namedIntKeyword contained key algorithm syn keyword namedIntKeyword contained secret nextgroup=namedString skipwhite " + these keywords are contained within `server' section only syn keyword namedIntKeyword contained bogus support-ixfr provide-ixfr request-ixfr edns nextgroup=namedBool,namedNotBool skipwhite syn keyword namedIntKeyword contained transfers edns-udp-size max-udp-size nextgroup=namedNumber,namedNotNumber skipwhite syn keyword namedIntKeyword contained transfer-format syn keyword namedIntKeyword contained keys nextgroup=namedIntSection skipwhite syn match namedIntKeyword contained /\/ nextgroup=namedSpareDot syn match namedDomain contained /"\."/ms=s+1,me=e-1 syn match namedSpareDot contained /\./ " --- syntax errors syn match namedIllegalDom contained /"\S*[^-A-Za-z0-9.[:space:]]\S*"/ms=s+1,me=e-1 syn match namedIPerror contained /\<\S*[^0-9.[:space:]a-fA-F:;]\S*/ syn match namedEParenError contained +{+ syn match namedParenError +}\([^;]\|$\)+ " Define the default highlighting. " 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_named_syn_inits") if version < 508 let did_named_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink namedComment Comment HiLink namedInclude Include HiLink namedKeyword Keyword HiLink namedIntKeyword Keyword HiLink namedIdentifier Identifier HiLink namedIntIdent Identifier HiLink namedString String HiLink namedBool Type HiLink namedNotBool Error HiLink namedNumber Number HiLink namedNotNumber Error HiLink namedOption namedKeyword HiLink namedLogOption namedKeyword HiLink namedCNOption namedKeyword HiLink namedQSKeywords Type HiLink namedCNKeywords Type HiLink namedCheckKeywords Type HiLink namedLOKeywords Type HiLink namedNotifyKeywords Type HiLink namedLogCategory Type HiLink namedIPaddr Number HiLink namedDomain Identifier HiLink namedZoneOpt namedKeyword HiLink namedZoneType Type HiLink namedParenError Error HiLink namedEParenError Error HiLink namedIllegalDom Error HiLink namedIPerror Error HiLink namedSpareDot Error HiLink namedError Error delcommand HiLink endif let &cpo = s:save_cpo unlet s:save_cpo let b:current_syntax = "named" " vim: ts=17