blob: 06d6885c1cb47732be2edab382a398b799f64c7d [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
Bram Moolenaarb21e5842006-04-16 18:30:08 +00002" Language: resolver configuration file
Bram Moolenaare6ae6222013-05-21 21:01:10 +02003" Maintainer: Radu Dineiu <radu.dineiu@gmail.com>
4" URL: https://raw.github.com/rid9/vim-resolv/master/resolv.vim
5" Last Change: 2013 May 21
6" Version: 1.0
7"
8" Credits:
9" David Necas (Yeti) <yeti@physics.muni.cz>
10" Stefano Zacchiroli <zack@debian.org>
Bram Moolenaar071d4272004-06-13 20:20:40 +000011
12if version < 600
13 syntax clear
14elseif exists("b:current_syntax")
15 finish
16endif
17
18" Errors, comments and operators
19syn match resolvError /./
Bram Moolenaare6ae6222013-05-21 21:01:10 +020020syn match resolvComment /\s*[#;].*$/
21syn match resolvOperator /[\/:]/ contained
Bram Moolenaar071d4272004-06-13 20:20:40 +000022
23" IP
Bram Moolenaar071d4272004-06-13 20:20:40 +000024syn cluster resolvIPCluster contains=resolvIPError,resolvIPSpecial
Bram Moolenaare6ae6222013-05-21 21:01:10 +020025syn match resolvIPError /\%(\d\{4,}\|25[6-9]\|2[6-9]\d\|[3-9]\d\{2}\)[\.0-9]*/ contained
Bram Moolenaar071d4272004-06-13 20:20:40 +000026syn match resolvIPSpecial /\%(127\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\)/ contained
27
28" General
29syn match resolvIP contained /\%(\d\{1,4}\.\)\{3}\d\{1,4}/ contains=@resolvIPCluster
30syn match resolvIPNetmask contained /\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\/\%(\%(\d\{1,4}\.\)\{,3}\d\{1,4}\)\)\?/ contains=resolvOperator,@resolvIPCluster
Bram Moolenaare6ae6222013-05-21 21:01:10 +020031syn match resolvHostname contained /\w\{-}\.[-0-9A-Za-z_\.]*/
Bram Moolenaar071d4272004-06-13 20:20:40 +000032
33" Particular
Bram Moolenaarb21e5842006-04-16 18:30:08 +000034syn match resolvIPNameserver contained /\%(\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\s\|$\)\)\+/ contains=@resolvIPCluster
35syn match resolvHostnameSearch contained /\%(\%([-0-9A-Za-z_]\+\.\)*[-0-9A-Za-z_]\+\.\?\%(\s\|$\)\)\+/
36syn match resolvIPNetmaskSortList contained /\%(\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\/\%(\%(\d\{1,4}\.\)\{,3}\d\{1,4}\)\)\?\%(\s\|$\)\)\+/ contains=resolvOperator,@resolvIPCluster
Bram Moolenaar071d4272004-06-13 20:20:40 +000037
38" Identifiers
Bram Moolenaarb21e5842006-04-16 18:30:08 +000039syn match resolvNameserver /^\s*nameserver\>/ nextgroup=resolvIPNameserver skipwhite
40syn match resolvLwserver /^\s*lwserver\>/ nextgroup=resolvIPNameserver skipwhite
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +020041syn match resolvDomain /^\s*domain\>/ nextgroup=resolvHostname skipwhite
Bram Moolenaarb21e5842006-04-16 18:30:08 +000042syn match resolvSearch /^\s*search\>/ nextgroup=resolvHostnameSearch skipwhite
43syn match resolvSortList /^\s*sortlist\>/ nextgroup=resolvIPNetmaskSortList skipwhite
44syn match resolvOptions /^\s*options\>/ nextgroup=resolvOption skipwhite
Bram Moolenaar071d4272004-06-13 20:20:40 +000045
46" Options
Bram Moolenaarb21e5842006-04-16 18:30:08 +000047syn match resolvOption /\<\%(debug\|no_tld_query\|rotate\|no-check-names\|inet6\)\>/ contained nextgroup=resolvOption skipwhite
48syn match resolvOption /\<\%(ndots\|timeout\|attempts\):\d\+\>/ contained contains=resolvOperator nextgroup=resolvOption skipwhite
Bram Moolenaar071d4272004-06-13 20:20:40 +000049
50" Additional errors
51syn match resolvError /^search .\{257,}/
Bram Moolenaar071d4272004-06-13 20:20:40 +000052
53if 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
Bram Moolenaarb21e5842006-04-16 18:30:08 +000071 HiLink resolvLwserver Identifier
Bram Moolenaar071d4272004-06-13 20:20:40 +000072 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
84endif
85
86let b:current_syntax = "resolv"
87
88" vim: ts=8 ft=vim