Tuesday, May 31, 2011

Re: highlight all words matching the word under the cursor

On 29.05.2011 11:31, Reuven Sayag wrote:
> 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.
>
Hi Reuven,

I have written a script that tries to mimic eclipse in this regard. I
have to say that it's not exactly as you want it because it highlights
in every filetype. But, I don't feel a slow down at all.

http://www.vim.org/scripts/script.php?script_id=1510

cu, Adam.

--
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:

Post a Comment