Jump Back to Previous Position After Visual Selection

Posted Sat Oct 29 @ 06:36:20 PM PDT 2011

When you use visual mode in Vim to apply some transformation to the selection (for example, indenting it), Vim jumps you back to the top of the visual selection (after performing the transformation).

In most cases, that's the opposite of what I want. Usually, I want my cursor to stay exactly where it was before applying the transformation.

To do that, use '> (to jump back to the line) or `> (to jump back to the line and column).

I was hoping '' or `` would do the trick, but they don't.

<< Home