Highlight identical strings in vi(m)

Posted by Boldewyn on Super User See other posts from Super User or by Boldewyn
Published on 2010-04-01T12:05:49Z Indexed on 2010/04/01 12:13 UTC
Read the original article Hit count: 226

Filed under:
|
|
|

One feature of Notepad++, which I find really useful and haven't found elsewhere, is the highlighting of other text that is identical to the one currently selected.

Is there something similar possible with vi(m)? (Of course, there is. But how do I achieve it?) That is, any of those:

  • If I am in Visual Mode and have text selected: Highlight identical text

  • If I have searched /foo, highlight all instances of foo.

  • If I am at the beginning of a string (series of characters, numbers or underscores), highlight all other matching strings (prefered solution).

The last one is similar to the closing parentheses matching and IMHO the most useful.

Edit: For my second use case, I found a solution (that is, Google found it...):

:set hls

However, the others remain.

© Super User or respective owner

Related posts about vim

Related posts about highlighting