Reputation: 11687
How can I indent code in command mode in Vim in the same way as = in visual mode?
Upvotes: 3
Views: 566
Reputation: 901
== will fix indentation on a single line
=% will fix indentation to the matching brace (if the cursor is on a brace)
gg=G will go to the top of the file gg and then fix indentation to the bottom of the file =G
summary - = is followed by an movement key and will fix indentation in the range specified by the motion.
This sheet shows the movement key in green, as you can see there are many options
Upvotes: 1