Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim: reverse visual mode perspective

Tags:

vim

Let's say you're using vim to select in visual mode. You hit v, then start moving to the right with l. Then, let's say you wish to extend your selection to the left, without changing the point at the right. That is, you're satisfied with '> but want to change '<.

How do you swap so that it is as if you started at '> and are selecting to the left, changing '<?

I have a vague recollection that I've seen this before, but it's hard to google for.

like image 448
Peter Avatar asked Feb 07 '12 22:02

Peter


1 Answers

Oops, amazing how posting to stackoverflow can make reading the (F) manual that much easier...

3. Changing the Visual area             *visual-change*

                            *v_o*
o           Go to Other end of highlighted text: The current
            cursor position becomes the start of the highlighted
            text and the cursor is moved to the other end of the
            highlighted text.  The highlighted area remains the
            same.
like image 81
Peter Avatar answered Oct 23 '22 06:10

Peter