vim: highlighting a search term without moving the cursor

Posted by ajwood on Super User See other posts from Super User or by ajwood
Published on 2011-03-08T21:48:38Z Indexed on 2011/03/09 0:12 UTC
Read the original article Hit count: 247

Filed under:
|
|

Using Vim, I sometimes find myself staring at a section of source code for a while and suddenly want some variable on the screen to pop out. That's easy: /<var> which highlights them all. My issue is that it more often than not the search shifts my window so I'm not looking at the source code from the same place. Even if it's only shifted a few lines, it's still throws me off since I need to take a few seconds to figure out where things have moved to.

Is it possible to highlight a search term without moving the cursor to the next match?

© Super User or respective owner

Related posts about vim

Related posts about search