Map <C-L> to clear search highlighting

<C-L> normally redraws the screen, so turning off search highlighting is
a natural addition.  But some people like it for <C-W>l, so don't
override it if it's already been mapped.

Note that hlsearch is currently left off by default.
This commit is contained in:
Tim Pope
2013-01-06 13:33:45 -05:00
parent 8207d1cd69
commit a95dc71f99

View File

@@ -23,6 +23,9 @@ set ttimeoutlen=50
set incsearch set incsearch
set smartcase set smartcase
if maparg('<C-L>', 'n') ==# ''
nnoremap <silent> <C-L> :nohls<CR><C-L>
endif
set laststatus=2 set laststatus=2
set ruler set ruler