Reputation: 101456
In vim, is it possible to highlight a search pattern without moving the cursor?
For example, if I want to find m_depthTable
I could do:
/m_depthTable
and that will highlight all instances of m_depthTable
, but it will also move to the next occurance.
I want to highlight without moving. Possible?
Upvotes: 6
Views: 394
Reputation: 31429
You could do a substitute command with the n flag. This won't move the cursor or do the substitute.
:s/pattern//n
Upvotes: 7
Reputation: 5047
You can write directly into register that contains last search pattern:
:let @/="m_depthTable"
Upvotes: 2