On Thu, 19 Mar 2015 11:14, Per Jessen <per@...> wrote:
In my copious spare time I was playing with updating the syntax highlighting for /etc/resolv.conf:
/usr/share/vim/current/syntax/resolv.vim
In my own .vim/after/syntax/resolv.vim I have added:
syn match resolvIPNameserver contained /\%([0-9A-Fa-f:.]\+\)\s*$/ contains=@resolvIPCluster
syn cluster resolvIPCluster contains=@resolvIPv4,@resolvIPv6
syn cluster resolvIPv4 contains=resolvIPError,resolvIPSpecial
syn match resolvIPv6 /\([0-9A-Fa-f]{0,4}:\)\{1,7}[0-9A-Fa-f]{1,4}$/ contained
The IPv6 check is at best rudimentary, but I can't quite make it work. If you copy the above and edit /etc/resolv.conf via vi/m, you'll see what I mean.
Well, I'm no guru at vim even if I use it since more than 2 decades. But, in the resolvIPv6 line one thing springs fore: The END. I'd change: "{1,4}$/" to "{1,4}\(\s\|$\)/" or even end with just "{1,4}/". As it is, it would read (IPv6_pattern)(End_of_line) and would only match if both is true. On IPv6 address matching, look at /usr/share/vim/current/syntax/pf.vim: syn match pfIPv6 /[a-fA-F0-9:]*::[a-fA-F0-9:.]*/ syn match pfIPv6 /[a-fA-F0-9:]\+:[a-fA-F0-9:]\+:[a-fA-F0-9:.]\+/ /usr/share/vim/current/syntax/bindzone.vim: multiple lines with "syn match *zoneIP6Addr" Sorry, limited knowledge here. - Yamaban -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org