Re-select visual block after indenting

10 Points

Daniel Imhoff Daniel Imhoff

4 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 4 years ago

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

Thank you very much!

Kazark

Kazark 4 years ago

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

Kazark

Kazark 4 years ago

Or, in combination with Snippet #106:

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

Zenith-One 4 years ago

You are the most heroic of heroes

yang-ling

yang-ling 4 years ago

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

Tobias Müller

Tobias Müller 2 years ago

Love this one! So simple, yet powerful :)