vim:aucmd: Improve highlighting on mode changes
When entering visual mode it does not really make sense to keep the cword highlighting but it should restart automatically (i.e. without CursorMoved) when leaving back out of visual mode. About directly starting selection highlighting I am still unsure since I rarely ever want to highlight only one character and it could decrease performance.
This commit is contained in:
@@ -123,7 +123,8 @@ augroup highlight_current
|
||||
\ endif
|
||||
au CursorMovedI * call HighlightCurrentWord()
|
||||
au WinLeave * call ClearHighlights()
|
||||
au ModeChanged [vV\x16]*:* call ClearHighlights(s:CLEAR_HIGHS_VISUAL)
|
||||
au ModeChanged [vV\x16]*:* call ClearHighlights(s:CLEAR_HIGHS_VISUAL) | call HighlightCurrentWord()
|
||||
au ModeChanged *:[vV\x16]* call ClearHighlights(s:CLEAR_HIGHS_CWORD) | call HighlightVisualSel()
|
||||
augroup END
|
||||
|
||||
" When switching focus to another window, keep the cursor location underlined.
|
||||
|
||||
Reference in New Issue
Block a user