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