From 1b365be8e7b3f870b265b3ab20237d0f13d89b57 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Thu, 9 Feb 2023 12:02:03 +0100 Subject: [PATCH] vim:aucmd: Underline old cursor position Underline old cursor position for better readability. Reusing `TermCursor` made me confuse the current window many times. My favorite solution would be an empty box around the position similar to how terminals do it when focus is lost. But I fear that this is not possible with a simple highlighting group. --- .config/vim/vimrc.d/80-autocommands.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/vim/vimrc.d/80-autocommands.vim b/.config/vim/vimrc.d/80-autocommands.vim index 06b3391..97ecc39 100644 --- a/.config/vim/vimrc.d/80-autocommands.vim +++ b/.config/vim/vimrc.d/80-autocommands.vim @@ -104,10 +104,10 @@ augroup highlight_current_word au CursorMovedI * call HighlightCurrentWord() augroup END -" When switching focus to another window, keep the cursor location highlighted. +" When switching focus to another window, keep the cursor location underlined. function! HighlightOldCursorPos() let w:cursor_pos_match_id = matchaddpos( - \ 'TermCursor', + \ 'Underlined', \ [getcurpos()[1:2]]) endfunction function! ClearOldCursorPos()