From 763e92e588f05f36219dc0d875f90b3115f33c40 Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Fri, 21 Jul 2023 00:05:36 +0200 Subject: [PATCH] vim: better keymap to clear search highlight --- config/nvim/lua/user/keymaps.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/nvim/lua/user/keymaps.lua b/config/nvim/lua/user/keymaps.lua index a641ffa..bf5a769 100644 --- a/config/nvim/lua/user/keymaps.lua +++ b/config/nvim/lua/user/keymaps.lua @@ -72,7 +72,8 @@ nmap('sp', 'set spell! | set spell?', { silent = true }) nmap('bg', [[let &background = &background ==? 'light' ? 'dark' : 'light']]) -- disable highlight until next search -nmap('h', 'nohlsearch') +nmap('', 'nohlsearch') +imap('', 'nohlsearch') -- more convenient way of entering normal mode from terminal mode tmap([[]], [[]])