Advertisement
Guest User

vim highlight ip addresses

a guest
Mar 15th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 0.46 KB | None | 0 0
  1. if has("autocmd")
  2.   highlight link ipaddress Identifier
  3.   autocmd Syntax * syn match ipaddress /\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|1\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|1\?\_[0-9]\_[0-9]\?\)\>/
  4.  
  5.   highlight link ipaddress_with_cidr Identifier
  6.   autocmd Syntax * syn match ipaddress_with_cidr /\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|1\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|1\?\_[0-9]\_[0-9]\?\)\/\(\_[1-2]\?\_[0-9]\|3\_[0-2]\)\>/
  7. endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement