VIM: Keep selection when using < or > in visual mode

When indenting or unindenting a code block, I normally visually select
it and use < or >. However, both of these unselect the selection.

The mappings make vim also do gv after such an action which re-selects
the previous selection.
This commit is contained in:
Jonathan Hodgson 2021-01-19 16:20:10 +00:00
parent d8e3b894c0
commit 9b4c064acd
4 changed files with 12 additions and 0 deletions

@ -0,0 +1 @@
Subproject commit c270950492d71bac0317d47d42cd0884eefe6490

@ -0,0 +1 @@
Subproject commit 0c5114e90837eac9af2150406f7821041e7e720b

View file

@ -71,3 +71,7 @@ nnoremap <leader>co :!opout <c-r>%<CR><CR>
" Makes vim default to "very magic" searching
nnoremap / /\v
vnoremap / /\v
" Makes vim re-select visual selection when using < or >
vnoremap < <gv
vnoremap > >gv