Guest User

Untitled

a guest
Nov 25th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 0.32 KB | None | 0 0
  1. function Highlighter()
  2.   let word_cursor = expand('<cword>')
  3.   redir => output
  4.   try
  5.     silent execute '%s/\<'.word_cursor.'\>//gn'
  6.   catch /^Vim\%((\a\+)\)\=:E486/
  7.     return
  8.   endtry
  9.   redir END
  10.   if str2nr(split(output)[0]) > 1
  11.     execute printf('match IncSearch /\<%s\>/', word_cursor)
  12.   endif
  13. endfunction
Add Comment
Please, Sign In to add comment