From b3f1a469db9ccb2cffc5937de4782e5d515c5d52 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Tue, 20 Feb 2024 01:19:55 +0100 Subject: [PATCH] vim:keys: Clear highlights on normal-mode Esc Clear highlights from visual selection or word highlighting together with the highlight of the search results. --- .config/vim/vimrc.d/40-keys.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/vim/vimrc.d/40-keys.vim b/.config/vim/vimrc.d/40-keys.vim index a979d4f..f6d7d87 100644 --- a/.config/vim/vimrc.d/40-keys.vim +++ b/.config/vim/vimrc.d/40-keys.vim @@ -1,7 +1,7 @@ " vim: set foldmethod=marker: " Keybindings """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Stop highlighting search result when pressing Return -nnoremap :nohlsearch +" Clear all kinds of highlights when pressing Escape in normal mode +nnoremap :nohlsearch call ClearHighlights() " Indentation jump " https://vim.fandom.com/wiki/Move_to_next/previous_line_with_same_indentation