summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2021-04-27 10:11:03 +0200
committerTobias Klauser <tklauser@distanz.ch>2021-04-27 10:11:03 +0200
commitf1ac2ec707a4bcf51e32fbfad590bd332842b4d2 (patch)
treed36d29027d9259074134932768f7ec9d14324d23
parentbeee3e97d9bd204f30981b0e7d9794b3bb5297a4 (diff)
Use Ctrl-L to clear highlighting
Take from vim-sensible
-rw-r--r--.vimrc5
1 files changed, 5 insertions, 0 deletions
diff --git a/.vimrc b/.vimrc
index 545b3d1..c83e1d3 100644
--- a/.vimrc
+++ b/.vimrc
@@ -8,6 +8,11 @@ set hidden " allow buffer switching without saving
set hlsearch
" Type-ahead find
set incsearch
+" Use <C-L> to clear the highlighting of :set hlsearch.
+" Taken from https://github.com/tpope/vim-sensible/blob/master/plugin/sensible.vim
+if maparg('<C-L>', 'n') ==# ''
+ nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L>
+endif
" Indent of 8, but no spaces
set shiftwidth=8