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