Indent and Auto-Indent

>> indents. << dedents. ={motion} re-indents using the language indenter.

Keys: >, <, =, >>, <<, ==

>{motion} indents a range one shiftwidth. <{motion} dedents. ={motion} runs the language's indent function. Doubled forms (>>, <<, ==) act on the current line.

>, <, and = are all operators. They take a motion or text object, like d and y. >ip indents the inner paragraph. =a{ re-indents the brace block.

Indent current line
KeyNote
>
>
Dedent current line
KeyNote
<
<
Indent inner paragraph
KeyNote
>
i
p
Re-indent inner paragraph (use language indenter)
KeyNote
=
i
p
Re-indent current line
KeyNote
=
=
>> โ€” indent line
<< โ€” dedent line
>{motion} โ€” indent range
={motion} โ€” auto-indent
== โ€” re-indent line

Worked example โ€” >> and <<

Indent and dedent the current line.

Step 1 ยท
transform.indent
Step 2 ยท >> ยท >> โ€” indented one shiftwidth.
>> โ€” indented one shiftwidth.

Doubled operator pattern. >ip indents an inner paragraph; >G indents to end of file.

โ–ถ Try this in the simulator

See also: The Universal Grammar, The Vim Grammar