Move visual block horizontally

2 Points

KillTheMule KillTheMule

8 years ago

In extension of, this maps the keys 'L' and 'H' in visual mode to moving the selection left and right resp. Behavior at the beginning/end of a line is not perfect, but there's always 'u' if you hit a key once too much.

vnoremap L <Esc>`<<C-v>`>odp`<<C-v>`>lol
vnoremap H <Esc>`<<C-v>`>odhP`<<C-v>`>hoh