0

I see this intriguing feature in Notepad++.

For the same in vim I need to:

  • click on a word
  • press *

If I'd like to check different words, I need to press * many times. And it will automatically move my cursor to next matching word, which is not I want.

Can this be done like auto-highlighting and don't move my cursor?

2 Answers 2

0

You have a few short scripts on this page.

0

Finally found how to do it: add following into .vimrc

autocmd CursorMoved * silent! exe printf('match Search /\<%s\>/', expand('<cword>'))
autocmd CursorHold *  silent! exe printf('match Search /\<%s\>/', expand('<cword>'))

And you can also replace the Search above with whatever highlight you like, even self-defined scheme.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .