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.
This commit is contained in:
2023-02-09 12:02:03 +01:00
parent 83b79aab10
commit 1b365be8e7

View File

@@ -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()