News for hackers. Stuff that matters.
Re:Staying the hell out of insert mode (vi) by philwelch on Monday April 26, 2010 @05:00PM (#1296032)
">" is the indent command. Repeat it ">>" to indent the current line. Use any other vim ranging construct (e.g. ">2j") to indent wider ranges--i.e. the current line plus two lines below.

"=" is the autoindent command. Vim recognizes many languages and you can give it plugins to understand more. Use "==" to autoindent the current line. My personal favorite, "gg=G", jumps to the top of the document and autoindents the entire thing. One time at work I was gently reminded how many spaces I was supposed to indent per the company's coding standard. I quickly set the relevant editor parameters and with four keystrokes my code was compliant.

I think there's a code-folding ability but I've never used it.

There are no comments on this comment yet.