Archive

Posts Tagged ‘hlsearch’

Clear highlighting on escape in normal mode

December 22, 2016 Leave a comment

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: ,