Home > vim > Clear highlighting on escape in normal mode

Clear highlighting on escape in normal mode

Problem:
How to disable highlighted text after doing a search in vim?

Solution:
Added the following to my .vimrc

 " Clear highlighting on escape in normal mode
 nnoremap <esc> :nohlsearch<return><esc>
 nnoremap <esc>^[ <esc>^[

System details:
vagrant box running ubuntu/trusty64

Source:
http://stackoverflow.com/questions/657447/vim-clear-last-search-highlighting?rq=1

Advertisements
Categories: vim Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: