diff options
| -rw-r--r-- | init.vim | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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, |