2 " Language: BIND 8.x configuration file
3 " Maintainer: glory hump <rnd@web-drive.ru>
4 " Last change: Mon May 21 04:51:01 SAMST 2001
5 " Filenames: named.conf
6 " URL: http://rnd.web-drive.ru/vim/syntax/named.vim
7 " $Id: named.vim,v 1.1.1.1 2001/06/07 21:35:12 corinna Exp $
10 " it was not widely tested, i just tried it on my simple
11 " single-master-single-slave configuration. most syntax was borrowed
12 " directly from "BIND Configuration File Guide" without testing.
14 " For version 5.x: Clear all syntax items
15 " For version 6.x: Quit when a syntax file was already loaded
18 elseif exists("b:current_syntax")
25 setlocal iskeyword=.,-,48-58,A-Z,a-z,_
27 set iskeyword=.,-,48-58,A-Z,a-z,_
30 " BIND configuration file
32 syn match namedComment "//.*"
33 syn region namedComment start="/\*" end="\*/"
34 syn region namedString start=/"/ end=/"/ contained
35 " --- omitted trailing semicolon FIXME
36 syn match namedError /[^;{]$/
38 " --- top-level keywords
40 syn keyword namedInclude include nextgroup=namedString skipwhite
41 syn keyword namedKeyword acl key nextgroup=namedIntIdent skipwhite
42 syn keyword namedKeyword server nextgroup=namedIdentifier skipwhite
43 syn keyword namedKeyword controls nextgroup=namedSection skipwhite
44 syn keyword namedKeyword trusted-keys nextgroup=namedIntSection skipwhite
45 syn keyword namedKeyword logging nextgroup=namedLogSection skipwhite
46 syn keyword namedKeyword options nextgroup=namedOptSection skipwhite
47 syn keyword namedKeyword zone nextgroup=namedZoneString skipwhite
49 " --- Identifier: name of following { ... } Section
50 syn match namedIdentifier contained /\k\+/ nextgroup=namedSection skipwhite
51 " --- IntIdent: name of following IntSection
52 syn match namedIntIdent contained /"\=\k\+"\=/ nextgroup=namedIntSection skipwhite
54 " --- Section: { ... } clause
55 syn region namedSection contained start=+{+ end=+};+ contains=namedSection,namedIntKeyword
57 " --- IntSection: section that does not contain other sections
58 syn region namedIntSection contained start=+{+ end=+}+ contains=namedIntKeyword,namedError
60 " --- IntKeyword: keywords contained within `{ ... }' sections only
61 " + these keywords are contained within `key' and `acl' sections
62 syn keyword namedIntKeyword contained key algorithm
63 syn keyword namedIntKeyword contained secret nextgroup=namedString skipwhite
65 " + these keywords are contained within `server' section only
66 syn keyword namedIntKeyword contained bogus support-ixfr nextgroup=namedBool,namedNotBool skipwhite
67 syn keyword namedIntKeyword contained transfers nextgroup=namedNumber,namedNotNumber skipwhite
68 syn keyword namedIntKeyword contained transfer-format
69 syn keyword namedIntKeyword contained keys nextgroup=namedIntSection skipwhite
71 " + these keywords are contained within `controls' section only
72 syn keyword namedIntKeyword contained inet nextgroup=namedIPaddr,namedIPerror skipwhite
73 syn keyword namedIntKeyword contained unix nextgroup=namedString skipwhite
74 syn keyword namedIntKeyword contained port perm owner group nextgroup=namedNumber,namedNotNumber skipwhite
75 syn keyword namedIntKeyword contained allow nextgroup=namedIntSection skipwhite
78 syn region namedOptSection contained start=+{+ end=+};+ contains=namedOption,namedCNOption,namedComment,namedParenError
80 syn keyword namedOption contained version directory
81 \ nextgroup=namedString skipwhite
82 syn keyword namedOption contained named-xfer dump-file pid-file
83 \ nextgroup=namedString skipwhite
84 syn keyword namedOption contained mem-statistics-file statistics-file
85 \ nextgroup=namedString skipwhite
86 syn keyword namedOption contained auth-nxdomain deallocate-on-exit
87 \ nextgroup=namedBool,namedNotBool skipwhite
88 syn keyword namedOption contained dialup fake-iquery fetch-glue
89 \ nextgroup=namedBool,namedNotBool skipwhite
90 syn keyword namedOption contained has-old-clients host-statistics
91 \ nextgroup=namedBool,namedNotBool skipwhite
92 syn keyword namedOption contained maintain-ixfr-base multiple-cnames
93 \ nextgroup=namedBool,namedNotBool skipwhite
94 syn keyword namedOption contained notify recursion rfc2308-type1
95 \ nextgroup=namedBool,namedNotBool skipwhite
96 syn keyword namedOption contained use-id-pool treat-cr-as-space
97 \ nextgroup=namedBool,namedNotBool skipwhite
98 syn keyword namedOption contained also-notify forwarders
99 \ nextgroup=namedIntSection skipwhite
100 syn keyword namedOption contained forward check-names
101 syn keyword namedOption contained allow-query allow-transfer allow-recursion nextgroup=namedAML skipwhite
102 syn keyword namedOption contained blackhole listen-on
103 \ nextgroup=namedIntSection skipwhite
104 syn keyword namedOption contained lame-ttl max-transfer-time-in
105 \ nextgroup=namedNumber,namedNotNumber skipwhite
106 syn keyword namedOption contained max-ncache-ttl min-roots
107 \ nextgroup=namedNumber,namedNotNumber skipwhite
108 syn keyword namedOption contained serial-queries transfers-in
109 \ nextgroup=namedNumber,namedNotNumber skipwhite
110 syn keyword namedOption contained transfers-out transfers-per-ns
111 syn keyword namedOption contained transfer-format
112 syn keyword namedOption contained transfer-source
113 \ nextgroup=namedIPaddr,namedIPerror skipwhite
114 syn keyword namedOption contained max-ixfr-log-size
115 \ nextgroup=namedNumber,namedNotNumber skipwhite
116 syn keyword namedOption contained coresize datasize files stacksize
117 syn keyword namedOption contained cleaning-interval interface-interval statistics-interval heartbeat-interval
118 \ nextgroup=namedNumber,namedNotNumber skipwhite
119 syn keyword namedOption contained topology sortlist rrset-order
120 \ nextgroup=namedIntSection skipwhite
122 syn match namedOption contained /\<query-source\s\+.*;/he=s+12 contains=namedQSKeywords
123 syn keyword namedQSKeywords contained address port
124 syn match namedCNOption contained /\<check-names\s\+.*;/he=s+11 contains=namedCNKeywords
125 syn keyword namedCNKeywords contained fail warn ignore master slave response
127 " --- logging facilities
128 syn region namedLogSection contained start=+{+ end=+};+ contains=namedLogOption
129 syn keyword namedLogOption contained channel nextgroup=namedIntIdent skipwhite
130 syn keyword namedLogOption contained category nextgroup=namedIntIdent skipwhite
131 syn keyword namedIntKeyword contained syslog null versions size severity
132 syn keyword namedIntKeyword contained file nextgroup=namedString skipwhite
133 syn keyword namedIntKeyword contained print-category print-severity print-time nextgroup=namedBool,namedNotBool skipwhite
136 syn region namedZoneString contained oneline start=+"+ end=+"+ skipwhite
137 \ contains=namedDomain,namedIllegalDom
138 \ nextgroup=namedZoneClass,namedZoneSection
139 syn keyword namedZoneClass contained in hs hesiod chaos
141 \ nextgroup=namedZoneSection skipwhite
143 syn region namedZoneSection contained start=+{+ end=+};+ contains=namedZoneOpt,namedCNOption,namedComment,namedMasters,namedParenError
144 syn keyword namedZoneOpt contained file ixfr-base
145 \ nextgroup=namedString skipwhite
146 syn keyword namedZoneOpt contained notify dialup
147 \ nextgroup=namedBool,namedNotBool skipwhite
148 syn keyword namedZoneOpt contained pubkey forward
149 syn keyword namedZoneOpt contained max-transfer-time-in
150 \ nextgroup=namedNumber,namedNotNumber skipwhite
151 syn keyword namedZoneOpt contained type nextgroup=namedZoneType skipwhite
152 syn keyword namedZoneType contained master slave stub forward hint
154 syn keyword namedZoneOpt contained masters forwarders
155 \ nextgroup=namedIPlist skipwhite
156 syn region namedIPlist contained start=+{+ end=+};+ contains=namedIPaddr,namedIPerror,namedParenError,namedComment
157 syn match namedZoneOpt contained "\<allow-\(update\|query\|transfer\)"
158 \ nextgroup=namedAML skipwhite
160 " --- boolean parameter
161 syn match namedNotBool contained "[^ ;]\+"
162 syn keyword namedBool contained yes no true false 1 0
164 " --- number parameter
165 syn match namedNotNumber contained "[^ 0-9;]\+"
166 syn match namedNumber contained "\d\+"
168 " --- address match list
169 syn region namedAML contained start=+{+ end=+};+ contains=namedParenError,namedComment
172 syn match namedIPaddr contained /\<[0-9]\{1,3}\(\.[0-9]\{1,3}\)\{3};/he=e-1
173 syn match namedDomain contained /\<[0-9A-Za-z][-0-9A-Za-z.]\+\>/ nextgroup=namedSpareDot
174 syn match namedDomain contained /"\."/ms=s+1,me=e-1
175 syn match namedSpareDot contained /\./
178 syn match namedIllegalDom contained /"\S*[^-A-Za-z0-9.[:space:]]\S*"/ms=s+1,me=e-1
179 syn match namedIPerror contained /\<\S*[^0-9.[:space:];]\S*/
180 syn match namedEParenError contained +{+
181 syn match namedParenError +}\([^;]\|$\)+
183 " Define the default highlighting.
184 " For version 5.7 and earlier: only when not done already
185 " For version 5.8 and later: only when an item doesn't have highlighting yet
186 if version >= 508 || !exists("did_named_syn_inits")
188 let did_named_syn_inits = 1
189 command -nargs=+ HiLink hi link <args>
191 command -nargs=+ HiLink hi def link <args>
194 HiLink namedComment Comment
195 HiLink namedInclude Include
196 HiLink namedKeyword Keyword
197 HiLink namedIntKeyword Keyword
198 HiLink namedIdentifier Identifier
199 HiLink namedIntIdent Identifier
201 HiLink namedString String
202 HiLink namedBool Type
203 HiLink namedNotBool Error
204 HiLink namedNumber Number
205 HiLink namedNotNumber Error
207 HiLink namedOption namedKeyword
208 HiLink namedLogOption namedKeyword
209 HiLink namedCNOption namedKeyword
210 HiLink namedQSKeywords Type
211 HiLink namedCNKeywords Type
212 HiLink namedLogCategory Type
213 HiLink namedDomain Identifier
214 HiLink namedZoneOpt namedKeyword
215 HiLink namedZoneType Type
216 HiLink namedParenError Error
217 HiLink namedEParenError Error
218 HiLink namedIllegalDom Error
219 HiLink namedIPerror Error
220 HiLink namedSpareDot Error
221 HiLink namedError Error
226 let b:current_syntax = "named"