2 " Language: DNS/BIND Zone File
3 " Maintainer: jehsom@jehsom.com
4 " URL: http://scripts.jehsom.com
5 " Last Change: 2001 May 17
7 " For version 5.x: Clear all syntax items
8 " For version 6.x: Quit when a syntax file was already loaded
11 elseif exists("b:current_syntax")
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}\>[ ]*$"
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")
29 let did_dns_syntax_inits = 1
30 command -nargs=+ HiLink hi link <args>
32 command -nargs=+ HiLink hi def link <args>
35 HiLink dnsComment Comment
36 HiLink dnsDataFQDN Identifier
37 HiLink dnsPreProc PreProc
38 HiLink dnsKeyword Keyword
39 HiLink dnsRecordName Type
42 HiLink dnsConstant Constant
47 let b:current_syntax = "dns"