Sunday, May 29, 2011

highlight all words matching the word under the cursor

Hi,
I'm looking for a way to highlight words that match the word under the
cursor.
I tried to put in my vimrc the following:
:autocmd CursorMoved *.cc,*.h,*.java exe printf('match IncSearch /\<%s
\>/', expand('<cword>'))

This works but it's a bit slow, and I don't really need it all the
time, Can someone add some info about how to toggle this behavior on a
function key (or a <Leader> h)?

Thanks,
Reuven.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: