Once I got the word with #
or *
how can go backward that command to not highlight the words.
Asked
Active
Viewed 86 times
0

Emmanuel
- 1
-
This command doesn't has anything to undo, i belive. – The Dreams Wind Apr 20 '22 at 15:45
-
1See `:help jumplist` and the commands `:help CTRL_O` and it's counterpart `:help CTRL_I`. To toggle highlighting, you can put this in your .vimrc: `nnoremap
/ (v:hlsearch ? ':nohls' : ':set hls')."\n"` -
1CTRL_O to undo the cursor movement. `/lkj;l;kj` to undo the highlighting. – William Pursell Apr 20 '22 at 16:04
-
1`:nohlsearch` is probably the "correct" way to turn off the highlighting, but searching for a random string works, too. – William Pursell Apr 20 '22 at 16:05
1 Answers
0
What is your goal, here?
If you want to go back to the previous match, then you could use *
after a #
or #
after a *
, or maybe :help ctrl-o
as a direction-agnostic alternative.
If you want to stay where you are but disable the search highlighting, then the proper way is to use :help :nohlsearch
. This is sadly cumbersome and there is no built-in way to do that automatically so vimmers have come up with many workarounds like the one suggested by @mattb in the comments. There are also a couple of plugins for that.

romainl
- 186,200
- 21
- 280
- 313