vim: avoid toggling the search highlight option

I usually want to clear the highlights after doing whatever the reason
for the search was, but having to re-enable it all the time was
annoying. So, using `:nohlsearch` fixes that, as this command does
exactly what I actually wanted all along.
This commit is contained in:
Fernando Schauenburg 2022-01-25 23:11:35 +01:00
parent 716709a783
commit 0828088421

View file

@ -62,8 +62,8 @@ register {
-- quickly change background
M('n', '<leader>bg', [[:let &background = &background ==? 'light' ? 'dark' : 'light'<cr>]]),
-- toggle search highlight
M('n', '<leader>h', ':set hlsearch!<cr>'),
-- disable highlight until next search
M('n', '<leader>h', ':nohlsearch<cr>'),
-- toggle NERDTree
M('n', '<leader>n', ':NERDTreeToggle<cr>'),