How to clear Vimperator search results

In Vimperator, press / and search. If there is a match, everything will be highlighted.

My question is how to properly clear these glare.

My current approach is to press / again and enter an arbitrary line, for example "abcdefgh", enter and press Esc to clear the red warning in the command window.

+6
source share
3 answers

Command :nohlsearch will remove the highlight of the search. You can match this with a key if you use it often.

+7
source

Enter the following to quickly clear the selected text.

: NOH

or you can switch it with

: install hls!

+9
source

Reorganization is awesome and you have to do it!

To add to the answers above:
You can reassign some of the keys to handle this automatically for you.
for example put this in your ~/.vimperatorrc

 " adjust search to enable highlight when searching and disable when escape is pressed noremap n :set hlsearch<return>n noremap <esc> :noh<return><esc> 

Explanation:
noremap - reassigns a sequence of keys without reassigning keys.
n for reassignment.
:set hlsearch<return>n , which we want the redirection function to activate selection in this case.

This will appear when you press n (for the next search result) and turn off when you press the escape button. You can also use / instead of n if you want the backlight to turn on when the search starts instantly.

+2
source

Source: https://habr.com/ru/post/956736/


All Articles