After I searched for a text with a pattern, all the matched text

stays highlighted. How do I turn off the highlighting temporarily/permanently? The ‘hlsearch’ option controls whether all the matches for the last searched pattern are highlighted or not. By default, this option is not enabled. If this option is set in a system-wide vimrc file, then you can turn off the search highlighting by using the following command:

    :set nohlsearch

To temporarily turn off the search highlighting, use

    :nohlsearch

You can also clear the search highlighting, by searching for a pattern that is not in the current file (for example, search for the pattern ‘asdf’). You can use this mapping, to clear the search highlighting when redrawing the window pressing <CTRL-L>

    :nnoremap   :nohls

Comments (1)


Pepsh Pepshinsky

Let’s see you to :help viminfo-file-name (option -i) :set viminfofile=NONE


Speak Your Mind