0
|
1 " Vim syntax file
|
|
2 " Language: resolver configuration file
|
48
|
3 " Maintainer: David Necas (Yeti) <yeti@physics.muni.cz>
|
0
|
4 " Original Maintaner: Radu Dineiu <littledragon@altern.org>
|
48
|
5 " License: This file can be redistributed and/or modified under the same terms
|
0
|
6 " as Vim itself.
|
48
|
7 " Last Change: 2012-05-24
|
0
|
8
|
|
9 if version < 600
|
|
10 syntax clear
|
|
11 elseif exists("b:current_syntax")
|
|
12 finish
|
|
13 endif
|
|
14
|
|
15 " Errors, comments and operators
|
|
16 syn match resolvError /./
|
48
|
17 syn match resolvComment /\s*[#;].*$/ contains=@Spell
|
|
18 syn match resolvOperator /[/:]/ contained
|
0
|
19
|
|
20 " IP
|
|
21 syn cluster resolvIPCluster contains=resolvIPError,resolvIPSpecial
|
48
|
22 syn match resolvIPError /\%(\d\{4,}\|25[6-9]\|2[6-9]\d\|[3-9]\d\{2}\)[.0-9]*/ contained
|
0
|
23 syn match resolvIPSpecial /\%(127\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\)/ contained
|
|
24
|
|
25 " General
|
|
26 syn match resolvIP contained /\%(\d\{1,4}\.\)\{3}\d\{1,4}/ contains=@resolvIPCluster
|
|
27 syn match resolvIPNetmask contained /\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\/\%(\%(\d\{1,4}\.\)\{,3}\d\{1,4}\)\)\?/ contains=resolvOperator,@resolvIPCluster
|
48
|
28 syn match resolvHostname contained /\w\{-}\.[-0-9A-Za-z_.]*/
|
0
|
29
|
|
30 " Particular
|
|
31 syn match resolvIPNameserver contained /\%(\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\s\|$\)\)\+/ contains=@resolvIPCluster
|
|
32 syn match resolvHostnameSearch contained /\%(\%([-0-9A-Za-z_]\+\.\)*[-0-9A-Za-z_]\+\.\?\%(\s\|$\)\)\+/
|
|
33 syn match resolvIPNetmaskSortList contained /\%(\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\/\%(\%(\d\{1,4}\.\)\{,3}\d\{1,4}\)\)\?\%(\s\|$\)\)\+/ contains=resolvOperator,@resolvIPCluster
|
|
34
|
|
35 " Identifiers
|
|
36 syn match resolvNameserver /^\s*nameserver\>/ nextgroup=resolvIPNameserver skipwhite
|
|
37 syn match resolvLwserver /^\s*lwserver\>/ nextgroup=resolvIPNameserver skipwhite
|
|
38 syn match resolvDomain /^\s*domain\>/ nextgroup=resolvHostname skipwhite
|
|
39 syn match resolvSearch /^\s*search\>/ nextgroup=resolvHostnameSearch skipwhite
|
|
40 syn match resolvSortList /^\s*sortlist\>/ nextgroup=resolvIPNetmaskSortList skipwhite
|
|
41 syn match resolvOptions /^\s*options\>/ nextgroup=resolvOption skipwhite
|
|
42
|
|
43 " Options
|
|
44 " FIXME: The manual page and the source code do not exactly agree on the set
|
|
45 " of allowed options
|
|
46 syn match resolvOption /\<\%(debug\|no_tld_query\|rotate\|no-check-names\|inet6\)\>/ contained nextgroup=resolvOption skipwhite
|
|
47 syn match resolvOption /\<\%(ndots\|timeout\|attempts\):\d\+\>/ contained contains=resolvOperator nextgroup=resolvOption skipwhite
|
|
48
|
|
49 " Additional errors
|
|
50 syn match resolvError /^search .\{257,}/
|
|
51
|
|
52 if version >= 508 || !exists("did_config_syntax_inits")
|
|
53 if version < 508
|
|
54 let did_config_syntax_inits = 1
|
|
55 command! -nargs=+ HiLink hi link <args>
|
|
56 else
|
|
57 command! -nargs=+ HiLink hi def link <args>
|
|
58 endif
|
|
59
|
|
60 HiLink resolvIP Number
|
|
61 HiLink resolvIPNetmask Number
|
|
62 HiLink resolvHostname String
|
|
63 HiLink resolvOption String
|
|
64
|
|
65 HiLink resolvIPNameserver Number
|
|
66 HiLink resolvHostnameSearch String
|
|
67 HiLink resolvIPNetmaskSortList Number
|
|
68
|
|
69 HiLink resolvNameServer Identifier
|
|
70 HiLink resolvLwserver Identifier
|
|
71 HiLink resolvDomain Identifier
|
|
72 HiLink resolvSearch Identifier
|
|
73 HiLink resolvSortList Identifier
|
|
74 HiLink resolvOptions Identifier
|
|
75
|
|
76 HiLink resolvComment Comment
|
|
77 HiLink resolvOperator Operator
|
|
78 HiLink resolvError Error
|
|
79 HiLink resolvIPError Error
|
|
80 HiLink resolvIPSpecial Special
|
|
81
|
|
82 delcommand HiLink
|
|
83 endif
|
|
84
|
|
85 let b:current_syntax = "resolv"
|
|
86
|
|
87 " vim: ts=8 ft=vim
|