Re-select visual block after indenting

10 Points

Daniel Imhoff Daniel Imhoff

8 years ago

It's stupid that indenting or unindenting a visual block deselects the block. Automatically 'gv' (go to previously selected visual block) after indenting or unindenting.

vnoremap < <gv
vnoremap > >gv

Florian Beer

Florian Beer 8 years ago

This is awesome. Exactly that behaviour was driving me mad.

Thank you very much!


Kazark 8 years ago

Wow. How did I not think of that for all these years. Why isn't this the default?


Kazark 8 years ago

Or, in combination with Snippet #106:

vnoremap <Tab> >gv vnoremap <S-Tab> <LT>gv

Zenith-One 8 years ago

You are the most heroic of heroes


yang-ling 8 years ago

If you want continuous indenting, you can use . command after > command in visual mode.

Tobias Müller

Tobias Müller 6 years ago

Love this one! So simple, yet powerful :)