codekingpro/portable-devtools
115k
1" Vim syntax file2" Language: BIND zone files (RFC 1035)3" Maintainer: Julian Mehnle <julian@mehnle.net>4" URL: http://www.mehnle.net/source/odds+ends/vim/syntax/5" Last Change: Thu 2011-07-16 20:42:00 UTC6" 7" Based on an earlier version by Вячеслав Горбанев (Slava Gorbanev), with8" heavy modifications.9" 10" $Id: bindzone.vim 12 2011-07-16 21:09:57Z julian $11 12" quit when a syntax file was already loaded13if exists("b:current_syntax")14 finish15endif16 17syn case match18 19" Directives20syn region zoneRRecord start=/^/ end=/$/ contains=zoneOwnerName,zoneSpecial,zoneTTL,zoneClass,zoneRRType,zoneComment,zoneUnknown21 22syn match zoneDirective /^\$ORIGIN\s\+/ nextgroup=zoneOrigin,zoneUnknown23syn match zoneDirective /^\$TTL\s\+/ nextgroup=zoneTTL,zoneUnknown24syn match zoneDirective /^\$INCLUDE\s\+/ nextgroup=zoneText,zoneUnknown25syn match zoneDirective /^\$GENERATE\s/26 27syn match zoneUnknown contained /\S\+/28 29syn match zoneOwnerName contained /^[^[:space:]!"#$%&'()*+,\/:;<=>?@[\]\^`{|}~]\+\(\s\|;\)\@=/ nextgroup=zoneTTL,zoneClass,zoneRRType skipwhite30syn match zoneOrigin contained /[^[:space:]!"#$%&'()*+,\/:;<=>?@[\]\^`{|}~]\+\(\s\|;\|$\)\@=/31syn match zoneDomain contained /[^[:space:]!"#$%&'()*+,\/:;<=>?@[\]\^`{|}~]\+\(\s\|;\|$\)\@=/32 33syn match zoneSpecial contained /^[@*.]\s/34syn match zoneTTL contained /\s\@<=\d[0-9WwDdHhMmSs]*\(\s\|$\)\@=/ nextgroup=zoneClass,zoneRRType skipwhite35syn keyword zoneClass contained IN CHAOS CH HS HESIOD nextgroup=zoneRRType,zoneTTL skipwhite36syn keyword zoneRRType contained A AAAA APL CAA CERT CNAME DNAME DNSKEY DS HINFO LOC MX NAPTR NS NSEC NSEC3 NSEC3PARAM OPENPGPKEY PTR RP RRSIG SMIMEA SOA SPF SRV SSHFP TLSA TXT nextgroup=zoneRData skipwhite37syn match zoneRData contained /[^;]*/ contains=zoneDomain,zoneIPAddr,zoneIP6Addr,zoneText,zoneNumber,zoneParen,zoneUnknown38 39syn match zoneIPAddr contained /\<[0-9]\{1,3}\(\.[0-9]\{1,3}\)\{,3}\>/40 41" Plain IPv6 address IPv6-embedded-IPv4 address42" 1111:2:3:4:5:6:7:8 1111:2:3:4:5:6:127.0.0.143syn match zoneIP6Addr contained /\<\(\x\{1,4}:\)\{6}\(\x\{1,4}:\x\{1,4}\|\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\>/44" ::[...:]8 ::[...:]127.0.0.145syn match zoneIP6Addr contained /\s\@<=::\(\(\x\{1,4}:\)\{,6}\x\{1,4}\|\(\x\{1,4}:\)\{,5}\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\>/46" 1111::[...:]8 1111::[...:]127.0.0.147syn match zoneIP6Addr contained /\<\(\x\{1,4}:\)\{1}:\(\(\x\{1,4}:\)\{,5}\x\{1,4}\|\(\x\{1,4}:\)\{,4}\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\>/48" 1111:2::[...:]8 1111:2::[...:]127.0.0.149syn match zoneIP6Addr contained /\<\(\x\{1,4}:\)\{2}:\(\(\x\{1,4}:\)\{,4}\x\{1,4}\|\(\x\{1,4}:\)\{,3}\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\>/50" 1111:2:3::[...:]8 1111:2:3::[...:]127.0.0.151syn match zoneIP6Addr contained /\<\(\x\{1,4}:\)\{3}:\(\(\x\{1,4}:\)\{,3}\x\{1,4}\|\(\x\{1,4}:\)\{,2}\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\>/52" 1111:2:3:4::[...:]8 1111:2:3:4::[...:]127.0.0.153syn match zoneIP6Addr contained /\<\(\x\{1,4}:\)\{4}:\(\(\x\{1,4}:\)\{,2}\x\{1,4}\|\(\x\{1,4}:\)\{,1}\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\>/54" 1111:2:3:4:5::[...:]8 1111:2:3:4:5::127.0.0.155syn match zoneIP6Addr contained /\<\(\x\{1,4}:\)\{5}:\(\(\x\{1,4}:\)\{,1}\x\{1,4}\|\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\>/56" 1111:2:3:4:5:6::8 -57syn match zoneIP6Addr contained /\<\(\x\{1,4}:\)\{6}:\x\{1,4}\>/58" 1111[:...]:: -59syn match zoneIP6Addr contained /\<\(\x\{1,4}:\)\{1,7}:\(\s\|;\|$\)\@=/60 61syn match zoneText contained /"\([^"\\]\|\\.\)*"\(\s\|;\|$\)\@=/62syn match zoneNumber contained /\<[0-9]\+\(\s\|;\|$\)\@=/63syn match zoneSerial contained /\<[0-9]\{1,10}\(\s\|;\|$\)\@=/64 65syn match zoneErrParen /)/66syn region zoneParen contained start="(" end=")" contains=zoneSerial,zoneTTL,zoneNumber,zoneComment67syn match zoneComment /;.*/68 69" Define the default highlighting.70" Only when an item doesn't have highlighting yet71 72hi def link zoneDirective Macro73 74hi def link zoneUnknown Error75 76hi def link zoneOrigin Statement77hi def link zoneOwnerName Statement78hi def link zoneDomain Identifier79 80hi def link zoneSpecial Special81hi def link zoneTTL Constant82hi def link zoneClass Include83hi def link zoneRRType Type84 85hi def link zoneIPAddr Number86hi def link zoneIP6Addr Number87hi def link zoneText String88hi def link zoneNumber Number89hi def link zoneSerial Special90 91hi def link zoneErrParen Error92hi def link zoneComment Comment93 94 95let b:current_syntax = "bindzone"96 97" vim:sts=2 sw=298 