This question already has an answer here:

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?

marked as duplicate by DJMcMayhem, Rich, 200_success, akshay, EvergreenTree Oct 22 '16 at 14:02

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


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.