7
|
1 " Vim syntax file
|
1121
|
2 " Language: BIND configuration file
|
|
3 " Maintainer: Nick Hibma <nick@van-laarhoven.org>
|
|
4 " Last change: 2007-01-30
|
|
5 " Filenames: named.conf, rndc.conf
|
|
6 " Location: http://www.van-laarhoven.org/vim/syntax/named.vim
|
7
|
7 "
|
1121
|
8 " Previously maintained by glory hump <rnd@web-drive.ru> and updated by Marcin
|
|
9 " Dalecki.
|
|
10 "
|
|
11 " This file could do with a lot of improvements, so comments are welcome.
|
|
12 " Please submit the named.conf (segment) with any comments.
|
|
13 "
|
7
|
14 " For version 5.x: Clear all syntax items
|
|
15 " For version 6.x: Quit when a syntax file was already loaded
|
|
16 if version < 600
|
|
17 syntax clear
|
|
18 elseif exists("b:current_syntax")
|
|
19 finish
|
|
20 endif
|
|
21
|
|
22 syn case match
|
|
23
|
|
24 if version >= 600
|
|
25 setlocal iskeyword=.,-,48-58,A-Z,a-z,_
|
|
26 else
|
|
27 set iskeyword=.,-,48-58,A-Z,a-z,_
|
|
28 endif
|
|
29
|
1121
|
30 if version >= 600
|
|
31 syn sync match namedSync grouphere NONE "^(zone|controls|acl|key)"
|
|
32 endif
|
|
33
|
7
|
34 let s:save_cpo = &cpo
|
|
35 set cpo-=C
|
|
36
|
|
37 " BIND configuration file
|
|
38
|
|
39 syn match namedComment "//.*"
|
44
|
40 syn match namedComment "#.*"
|
7
|
41 syn region namedComment start="/\*" end="\*/"
|
|
42 syn region namedString start=/"/ end=/"/ contained
|
44
|
43 " --- omitted trailing semicolon
|
|
44 syn match namedError /[^;{#]$/
|
7
|
45
|
|
46 " --- top-level keywords
|
|
47
|
|
48 syn keyword namedInclude include nextgroup=namedString skipwhite
|
|
49 syn keyword namedKeyword acl key nextgroup=namedIntIdent skipwhite
|
|
50 syn keyword namedKeyword server nextgroup=namedIdentifier skipwhite
|
|
51 syn keyword namedKeyword controls nextgroup=namedSection skipwhite
|
|
52 syn keyword namedKeyword trusted-keys nextgroup=namedIntSection skipwhite
|
|
53 syn keyword namedKeyword logging nextgroup=namedLogSection skipwhite
|
|
54 syn keyword namedKeyword options nextgroup=namedOptSection skipwhite
|
|
55 syn keyword namedKeyword zone nextgroup=namedZoneString skipwhite
|
|
56
|
|
57 " --- Identifier: name of following { ... } Section
|
|
58 syn match namedIdentifier contained /\k\+/ nextgroup=namedSection skipwhite
|
|
59 " --- IntIdent: name of following IntSection
|
|
60 syn match namedIntIdent contained /"\=\k\+"\=/ nextgroup=namedIntSection skipwhite
|
|
61
|
|
62 " --- Section: { ... } clause
|
|
63 syn region namedSection contained start=+{+ end=+};+ contains=namedSection,namedIntKeyword
|
|
64
|
|
65 " --- IntSection: section that does not contain other sections
|
|
66 syn region namedIntSection contained start=+{+ end=+}+ contains=namedIntKeyword,namedError
|
|
67
|
|
68 " --- IntKeyword: keywords contained within `{ ... }' sections only
|
|
69 " + these keywords are contained within `key' and `acl' sections
|
|
70 syn keyword namedIntKeyword contained key algorithm
|
|
71 syn keyword namedIntKeyword contained secret nextgroup=namedString skipwhite
|
|
72
|
|
73 " + these keywords are contained within `server' section only
|
|
74 syn keyword namedIntKeyword contained bogus support-ixfr nextgroup=namedBool,namedNotBool skipwhite
|
|
75 syn keyword namedIntKeyword contained transfers nextgroup=namedNumber,namedNotNumber skipwhite
|
|
76 syn keyword namedIntKeyword contained transfer-format
|
|
77 syn keyword namedIntKeyword contained keys nextgroup=namedIntSection skipwhite
|
|
78
|
|
79 " + these keywords are contained within `controls' section only
|
|
80 syn keyword namedIntKeyword contained inet nextgroup=namedIPaddr,namedIPerror skipwhite
|
|
81 syn keyword namedIntKeyword contained unix nextgroup=namedString skipwhite
|
|
82 syn keyword namedIntKeyword contained port perm owner group nextgroup=namedNumber,namedNotNumber skipwhite
|
|
83 syn keyword namedIntKeyword contained allow nextgroup=namedIntSection skipwhite
|
|
84
|
1121
|
85 " + these keywords are contained within `update-policy' section only
|
|
86 syn keyword namedIntKeyword contained grant nextgroup=namedString skipwhite
|
|
87 syn keyword namedIntKeyword contained name self subdomain wildcard nextgroup=namedString skipwhite
|
|
88 syn keyword namedIntKeyword TXT A PTR NS SOA A6 CNAME MX ANY skipwhite
|
|
89
|
7
|
90 " --- options
|
|
91 syn region namedOptSection contained start=+{+ end=+};+ contains=namedOption,namedCNOption,namedComment,namedParenError
|
|
92
|
|
93 syn keyword namedOption contained version directory
|
|
94 \ nextgroup=namedString skipwhite
|
|
95 syn keyword namedOption contained named-xfer dump-file pid-file
|
|
96 \ nextgroup=namedString skipwhite
|
|
97 syn keyword namedOption contained mem-statistics-file statistics-file
|
|
98 \ nextgroup=namedString skipwhite
|
|
99 syn keyword namedOption contained auth-nxdomain deallocate-on-exit
|
|
100 \ nextgroup=namedBool,namedNotBool skipwhite
|
|
101 syn keyword namedOption contained dialup fake-iquery fetch-glue
|
|
102 \ nextgroup=namedBool,namedNotBool skipwhite
|
|
103 syn keyword namedOption contained has-old-clients host-statistics
|
|
104 \ nextgroup=namedBool,namedNotBool skipwhite
|
|
105 syn keyword namedOption contained maintain-ixfr-base multiple-cnames
|
|
106 \ nextgroup=namedBool,namedNotBool skipwhite
|
|
107 syn keyword namedOption contained notify recursion rfc2308-type1
|
|
108 \ nextgroup=namedBool,namedNotBool skipwhite
|
|
109 syn keyword namedOption contained use-id-pool treat-cr-as-space
|
|
110 \ nextgroup=namedBool,namedNotBool skipwhite
|
|
111 syn keyword namedOption contained also-notify forwarders
|
1121
|
112 \ nextgroup=namedIPlist skipwhite
|
7
|
113 syn keyword namedOption contained forward check-names
|
1121
|
114 syn keyword namedOption contained allow-query allow-transfer allow-recursion
|
|
115 \ nextgroup=namedAML skipwhite
|
7
|
116 syn keyword namedOption contained blackhole listen-on
|
|
117 \ nextgroup=namedIntSection skipwhite
|
|
118 syn keyword namedOption contained lame-ttl max-transfer-time-in
|
|
119 \ nextgroup=namedNumber,namedNotNumber skipwhite
|
|
120 syn keyword namedOption contained max-ncache-ttl min-roots
|
|
121 \ nextgroup=namedNumber,namedNotNumber skipwhite
|
|
122 syn keyword namedOption contained serial-queries transfers-in
|
|
123 \ nextgroup=namedNumber,namedNotNumber skipwhite
|
|
124 syn keyword namedOption contained transfers-out transfers-per-ns
|
|
125 syn keyword namedOption contained transfer-format
|
|
126 syn keyword namedOption contained transfer-source
|
|
127 \ nextgroup=namedIPaddr,namedIPerror skipwhite
|
|
128 syn keyword namedOption contained max-ixfr-log-size
|
|
129 \ nextgroup=namedNumber,namedNotNumber skipwhite
|
|
130 syn keyword namedOption contained coresize datasize files stacksize
|
|
131 syn keyword namedOption contained cleaning-interval interface-interval statistics-interval heartbeat-interval
|
|
132 \ nextgroup=namedNumber,namedNotNumber skipwhite
|
|
133 syn keyword namedOption contained topology sortlist rrset-order
|
|
134 \ nextgroup=namedIntSection skipwhite
|
|
135
|
|
136 syn match namedOption contained /\<query-source\s\+.*;/he=s+12 contains=namedQSKeywords
|
|
137 syn keyword namedQSKeywords contained address port
|
|
138 syn match namedCNOption contained /\<check-names\s\+.*;/he=s+11 contains=namedCNKeywords
|
|
139 syn keyword namedCNKeywords contained fail warn ignore master slave response
|
|
140
|
|
141 " --- logging facilities
|
|
142 syn region namedLogSection contained start=+{+ end=+};+ contains=namedLogOption
|
|
143 syn keyword namedLogOption contained channel nextgroup=namedIntIdent skipwhite
|
|
144 syn keyword namedLogOption contained category nextgroup=namedIntIdent skipwhite
|
|
145 syn keyword namedIntKeyword contained syslog null versions size severity
|
|
146 syn keyword namedIntKeyword contained file nextgroup=namedString skipwhite
|
|
147 syn keyword namedIntKeyword contained print-category print-severity print-time nextgroup=namedBool,namedNotBool skipwhite
|
|
148
|
|
149 " --- zone section
|
|
150 syn region namedZoneString contained oneline start=+"+ end=+"+ skipwhite
|
|
151 \ contains=namedDomain,namedIllegalDom
|
|
152 \ nextgroup=namedZoneClass,namedZoneSection
|
|
153 syn keyword namedZoneClass contained in hs hesiod chaos
|
|
154 \ IN HS HESIOD CHAOS
|
|
155 \ nextgroup=namedZoneSection skipwhite
|
|
156
|
|
157 syn region namedZoneSection contained start=+{+ end=+};+ contains=namedZoneOpt,namedCNOption,namedComment,namedMasters,namedParenError
|
|
158 syn keyword namedZoneOpt contained file ixfr-base
|
|
159 \ nextgroup=namedString skipwhite
|
|
160 syn keyword namedZoneOpt contained notify dialup
|
|
161 \ nextgroup=namedBool,namedNotBool skipwhite
|
|
162 syn keyword namedZoneOpt contained pubkey forward
|
|
163 syn keyword namedZoneOpt contained max-transfer-time-in
|
|
164 \ nextgroup=namedNumber,namedNotNumber skipwhite
|
|
165 syn keyword namedZoneOpt contained type nextgroup=namedZoneType skipwhite
|
|
166 syn keyword namedZoneType contained master slave stub forward hint
|
|
167
|
|
168 syn keyword namedZoneOpt contained masters forwarders
|
|
169 \ nextgroup=namedIPlist skipwhite
|
|
170 syn region namedIPlist contained start=+{+ end=+};+ contains=namedIPaddr,namedIPerror,namedParenError,namedComment
|
1121
|
171 syn keyword namedZoneOpt contained allow-update allow-query allow-transfer
|
7
|
172 \ nextgroup=namedAML skipwhite
|
1121
|
173 syn keyword namedZoneOpt contained update-policy
|
|
174 \ nextgroup=namedIntSection skipwhite
|
7
|
175
|
|
176 " --- boolean parameter
|
|
177 syn match namedNotBool contained "[^ ;]\+"
|
|
178 syn keyword namedBool contained yes no true false 1 0
|
|
179
|
|
180 " --- number parameter
|
|
181 syn match namedNotNumber contained "[^ 0-9;]\+"
|
|
182 syn match namedNumber contained "\d\+"
|
|
183
|
|
184 " --- address match list
|
1121
|
185 syn region namedAML contained start=+{+ end=+};+ contains=namedParenError,namedComment,namedString
|
7
|
186
|
|
187 " --- IPs & Domains
|
|
188 syn match namedIPaddr contained /\<[0-9]\{1,3}\(\.[0-9]\{1,3}\)\{3};/he=e-1
|
|
189 syn match namedDomain contained /\<[0-9A-Za-z][-0-9A-Za-z.]\+\>/ nextgroup=namedSpareDot
|
|
190 syn match namedDomain contained /"\."/ms=s+1,me=e-1
|
|
191 syn match namedSpareDot contained /\./
|
|
192
|
|
193 " --- syntax errors
|
|
194 syn match namedIllegalDom contained /"\S*[^-A-Za-z0-9.[:space:]]\S*"/ms=s+1,me=e-1
|
|
195 syn match namedIPerror contained /\<\S*[^0-9.[:space:];]\S*/
|
|
196 syn match namedEParenError contained +{+
|
|
197 syn match namedParenError +}\([^;]\|$\)+
|
|
198
|
|
199 " Define the default highlighting.
|
|
200 " For version 5.7 and earlier: only when not done already
|
|
201 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
202 if version >= 508 || !exists("did_named_syn_inits")
|
|
203 if version < 508
|
|
204 let did_named_syn_inits = 1
|
|
205 command -nargs=+ HiLink hi link <args>
|
|
206 else
|
|
207 command -nargs=+ HiLink hi def link <args>
|
|
208 endif
|
|
209
|
|
210 HiLink namedComment Comment
|
|
211 HiLink namedInclude Include
|
|
212 HiLink namedKeyword Keyword
|
|
213 HiLink namedIntKeyword Keyword
|
|
214 HiLink namedIdentifier Identifier
|
|
215 HiLink namedIntIdent Identifier
|
|
216
|
|
217 HiLink namedString String
|
|
218 HiLink namedBool Type
|
|
219 HiLink namedNotBool Error
|
|
220 HiLink namedNumber Number
|
|
221 HiLink namedNotNumber Error
|
|
222
|
|
223 HiLink namedOption namedKeyword
|
|
224 HiLink namedLogOption namedKeyword
|
|
225 HiLink namedCNOption namedKeyword
|
|
226 HiLink namedQSKeywords Type
|
|
227 HiLink namedCNKeywords Type
|
|
228 HiLink namedLogCategory Type
|
1121
|
229 HiLink namedIPaddr Number
|
7
|
230 HiLink namedDomain Identifier
|
|
231 HiLink namedZoneOpt namedKeyword
|
|
232 HiLink namedZoneType Type
|
|
233 HiLink namedParenError Error
|
|
234 HiLink namedEParenError Error
|
|
235 HiLink namedIllegalDom Error
|
|
236 HiLink namedIPerror Error
|
|
237 HiLink namedSpareDot Error
|
|
238 HiLink namedError Error
|
|
239
|
|
240 delcommand HiLink
|
|
241 endif
|
|
242
|
|
243 let &cpo = s:save_cpo
|
|
244 unlet s:save_cpo
|
|
245
|
|
246 let b:current_syntax = "named"
|
|
247
|
|
248 " vim: ts=17
|