Skip to content

Commit 149283a

Browse files
author
steve
committed
- Added 'syn sync fromstart' so that artifact doesn't appear when re-editing a file back into the middle of a file.
- Added CAA syntaxes. - Tweak for OPENPGPKEY so that highlighting of things inside a pair of parenthesis gets better done.
1 parent 5a0676e commit 149283a

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

syntax/bindzone.vim

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ endif
1212

1313
syn case match
1414

15+
syn sync fromstart
16+
1517
" Directives
1618
syn region zoneRRecord start=/\v^/ end=/\v$/ contains=zoneOwnerName,zoneSpecial,zoneComment,zoneUnknown
1719

@@ -33,6 +35,10 @@ hi def link zoneOrigin Statement
3335
syn match zoneDomain contained /\v([^[:space:]!"#$%&'()*+,\/:;<=>?@[\]\^`{|}~]+|\@)(\s|;|$)@=/
3436
hi def link zoneDomain Underlined
3537

38+
" syn match zoneCAA_QuotedTagValue contained /\v"(([\x21-\x3a])|([\x37-\x7e])){1,255)"(\s|;|$)@=/
39+
syn match zoneCAA_QuotedTagValue contained /\v"(([\x21\x23-\x7e])){1,255}"/
40+
hi def link zoneCAA_QuotedTagValue String
41+
3642
syn match zoneSpecial contained /\v^(\@|\*(\.\S*)?)\s@=/ nextgroup=zoneTTL,zoneClass,zoneRRType skipwhite
3743
hi def link zoneSpecial Special
3844

@@ -42,6 +48,33 @@ hi def link zoneTTL Constant
4248
syn keyword zoneClass contained IN CHAOS CH HS ANY nextgroup=zoneRRType,zoneTTL skipwhite
4349
hi def link zoneClass Include
4450

51+
syn match zoneCAA_unknown_tag contained
52+
\ /\v<[a-zA-Z0-9]{1,64}>/
53+
\ skipwhite
54+
\ nextgroup=zoneCAA_QuotedTagValue
55+
hi def link zoneCAA_unknown_tag Special
56+
57+
syn match zoneCAA_property_issue contained /issue/ skipwhite
58+
\ nextgroup=zoneCAA_QuotedTagValue
59+
hi def link zoneCAA_property_issue Variable
60+
61+
syn match zoneCAA_property_issuewild contained /issuewild/ skipwhite
62+
\ nextgroup=zoneCAA_QuotedTagValue
63+
hi def link zoneCAA_property_issuewild Variable
64+
65+
syn match zoneCAA_property_iodef contained /iodef/ skipwhite
66+
\ nextgroup=zoneCAA_QuotedTagValue
67+
hi def link zoneCAA_property_iodef Variable
68+
69+
syn match zoneCAA_Number contained /\v\d{1,3}/ skipwhite
70+
\ nextgroup=
71+
\ zoneCAA_property_issue,
72+
\ zoneCAA_property_issuewild,
73+
\ zoneCAA_property_iodef,
74+
\ zoneCAA_unknown_tag
75+
hi def link zoneCAA_Number Constant
76+
77+
4578
let s:dataRegexp = {}
4679
let s:dataRegexp["zoneNumber"] = "/\\v<[0-9]+>/"
4780
let s:dataRegexp["zoneDomain"] = "/\\v[^[:space:]!\"#$%&'()*+,\\/:;<=>?@[\\]\\^`{|}~]+[^[:space:]!\"#$%&'()*+,\\/:;<=>?@[\\]\\^`{|}~]@!/"
@@ -122,6 +155,8 @@ endfunction
122155
syn keyword zoneRRType contained A nextgroup=zoneIPAddr skipwhite
123156
syn keyword zoneRRType contained AAAA nextgroup=zoneIP6Addr skipwhite
124157
syn keyword zoneRRType contained NS CNAME PTR DNAME nextgroup=zoneDomain skipwhite
158+
syn keyword zoneRRType contained CAA skipwhite
159+
\ nextgroup=zoneCAA_Number
125160
call s:createChain("OPENPGPKEY", ["zoneHex"])
126161
call s:createChain("MX", ["zoneNumber", "zoneDomain"])
127162
call s:createChain("SRV", ["zoneNumber", "zoneNumber", "zoneNumber", "zoneDomain"])
@@ -139,8 +174,8 @@ syn keyword zoneRRType contained WKS HINFO RP
139174
\ DHCID SMIMEA HIP NINFO RKEY TALINK CDS CDSNKEY CSYNC ZONEMD
140175
\ SVCB HTTPS SPF UINFO UID
141176
\ GID UNSPEC NID L32 L64 LP
142-
\ TKEY TSIG IXFR AXFR
143-
\ URI CAA AVC DOA AMTRELAY TA
177+
\ TKEY TSIG IXFR AXFR
178+
\ URI AVC DOA AMTRELAY TA OPENPGPKEY
144179
\ nextgroup=zoneRData skipwhite
145180
syn match zoneRRType contained /\vTYPE\d+/ nextgroup=zoneUnknownType1 skipwhite
146181
hi def link zoneRRType Type

0 commit comments

Comments
 (0)