7
|
1 " Vim syntax file
|
|
2 " Language: DNS/BIND Zone File
|
|
3 " Maintainer: jehsom@jehsom.com
|
|
4 " URL: http://scripts.jehsom.com
|
|
5 " Last Change: 2001 Sep 02
|
|
6
|
|
7 " For version 5.x: Clear all syntax items
|
|
8 " For version 6.x: Quit when a syntax file was already loaded
|
|
9 if version < 600
|
|
10 syntax clear
|
|
11 elseif exists("b:current_syntax")
|
|
12 finish
|
|
13 endif
|
|
14
|
|
15 " Last match is taken!
|
|
16 syn match dnsKeyword "\<\(IN\|A\|SOA\|NS\|CNAME\|MX\|PTR\|SOA\|MB\|MG\|MR\|NULL\|WKS\|HINFO\|TXT\|CS\|CH\|CPU\|OS\)\>"
|
|
17 syn match dnsRecordName "^[^ ]*"
|
|
18 syn match dnsPreProc "^\$[^ ]*"
|
|
19 syn match dnsComment ";.*$"
|
|
20 syn match dnsDataFQDN "\<[^ ]*\.[ ]*$"
|
|
21 syn match dnsConstant "\<\([0-9][0-9.]*\|[0-9.]*[0-9]\)\>"
|
|
22 syn match dnsIPaddr "\<\(\([0-2]\)\{0,1}\([0-9]\)\{1,2}\.\)\{3}\([0-2]\)\{0,1}\([0-9]\)\{1,2}\>[ ]*$"
|
|
23
|
|
24 " Define the default highlighting.
|
|
25 " For version 5.7 and earlier: only when not done already
|
|
26 " For version 5.8 and later: only when an item doesn't have highlighting yet.
|
|
27 if version >= 508 || !exists("did_dns_syntax_inits")
|
|
28 if version < 508
|
|
29 let did_dns_syntax_inits = 1
|
|
30 command -nargs=+ HiLink hi link <args>
|
|
31 else
|
|
32 command -nargs=+ HiLink hi def link <args>
|
|
33 endif
|
|
34
|
|
35 HiLink dnsComment Comment
|
|
36 HiLink dnsDataFQDN Identifier
|
|
37 HiLink dnsPreProc PreProc
|
|
38 HiLink dnsKeyword Keyword
|
|
39 HiLink dnsRecordName Type
|
|
40 HiLink dnsIPaddr Type
|
|
41 HiLink dnsIPerr Error
|
|
42 HiLink dnsConstant Constant
|
|
43
|
|
44 delcommand HiLink
|
|
45 endif
|
|
46
|
|
47 let b:current_syntax = "dns"
|