Using the * key searches for the word under the cursor.

Use # to do the same, backwards.

When search is active, all instances of word appears highlighted. I want to know if is possible to remove the highlight selection.


1 Answer 1


hlsearch controls this; it can be turned off with :set nohlsearch. This affects all sorts of searches, however, and not just * and #. One could, theoretically, remap * and # to do what they do and then execute :nohlsearch (or :noh) with :nnoremap * * :noh<CR> and :nnoremap # # :noh<CR> to clear highlighting every time a * or # is performed. The highlighting will still flicker, but clear essentially immediately.

  • Thank you. I forgot that option in my vimrc ^_^ thank you very much
    – sensorario
    Apr 26, 2018 at 0:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.