12

Hitting >3j indents the current line and the three below it, and >3k does the same but with the three lines above. However, when indenting down, my cursor is left on the same line as it started, but when indenting up, the cursor moves to the top most indented line. Why?

Do Vim automatically move to the top most indented line, but that just happens to be the same as the starting line when indenting downwards, or is there something else behind it?

0

1 Answer 1

13

Yes, Vim automatically moves to the top most indented line. To see this, position the cursor in the middle of a paragraph and use >ap to indent the whole paragraph.

Note that this is not specific to indenting. If you use !ipsort to sort all lines of the current paragraph, the cursor moves to the top of the sorted paragraph as well.

Not the answer you're looking for? Browse other questions tagged or ask your own question.