`v` in visual mode switches between modes

2 Points

Rom Grk Rom Grk

6 years ago

v(lowercase) ends visual mode if mode is visual character-wise. This allows it to cycle through visual modes: visual -> visual-block -> visual-line -> visual

xnoremap <expr> v
            \ (mode() ==# 'v' ? "\<C-V>"
            \ : mode() ==# 'V' ? 'v' : 'V')