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.

marked as duplicate by statox Apr 26 '18 at 7:20

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


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 '18 at 0:12

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