I have a text file opened in Spacemacs with evil mode on. When I search for a term by means of /term [Enter] then found "term"s are highlighed.

How do I remove that highlighting? I tried / [Enter] - that didn't work. The highlighting will stick around even after switching to insert mode.


You can achieve the same as entering :noh with the command evil-ex-nohighlight.

But since you are using spacemacs, it can be even simpler: hit SPC s c to clear highlights.

  • SPC s c is what I was looking for - thanks – Raffael Aug 21 '18 at 16:35

Do it just like you would do in Vim (I've checked, / RET doesn't work with :set hlsearch), use :noh.

  • can I make this permanent by adding it to .spacemacs? – Raffael Aug 19 '18 at 16:58
  • I don't understand. :noh is a command you execute to undo highlights. The next time you search, you get the results highlighted. Are you looking for something to prevent search highlights? – wasamasa Aug 19 '18 at 18:58
  • let's say I hoped for something more ergonomic than having to enter :noh after using highlighting. but :noh will do the trick. – Raffael Aug 19 '18 at 19:21
  • That's fine, I'm asking about your intention. You do understand that a search will highlight the results unless configured otherwise, don't you? – wasamasa Aug 19 '18 at 19:38
  • Is there a way of having the highlights go away after a few seconds of performing a search? – Patrick Brinich-Langlois Apr 2 '20 at 17:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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