summaryrefslogtreecommitdiff
path: root/init.vim
diff options
context:
space:
mode:
Diffstat (limited to 'init.vim')
-rw-r--r--init.vim8
1 files changed, 4 insertions, 4 deletions
diff --git a/init.vim b/init.vim
index bca3c9d..1445e6e 100644
--- a/init.vim
+++ b/init.vim
@@ -166,10 +166,8 @@ augroup InitVim
au!
" Automatically stop highligting things when leaving insert mode. If I want
" the highlight back, I can just hit 'n' and it will come back.
- "
- " I don't know why it can't just be 'noh' and why I have to do this feedkeys
- " nonsense, but there appears to be a bug of some kind.
- autocmd InsertLeave * call feedkeys("\<cmd>noh\<cr>")
+ autocmd InsertLeave * set nohlsearch | redraw
+ autocmd CmdlineEnter /,\? set hlsearch
autocmd TextYankPost *
\ lua require'vim.hl'.on_yank(
@@ -178,6 +176,8 @@ augroup InitVim
" autocmd CursorHoldI * lua vim.lsp.buf.document_highlight()
" autocmd CursorMoved * lua vim.lsp.buf.clear_references()
augroup END
+nnoremap <silent> n <cmd>set hlsearch<CR>n
+nnoremap <silent> N <cmd>set hlsearch<CR>N
" Local configuration that can be set by hostname or just a local configuration.
" Local files are ignored by .gitignore so they won't be added to the repo,