Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using vim on Ubuntu 10.10.

In order to indent code, I enter >. But I have to do it twice.

Other command, like < and = are the same. I have to do it twice.

Is it normal? Of I should change something?

How can I fix this?

share|improve this question

4 Answers 4

up vote 3 down vote accepted

That is the normal operation. The first > starts the indent command. The second > commits the indent command. What you put in between defines what you want to indent (defaults to 1 line):

  • >> is indent one line.
  • >5> is indent 5 lines
  • >G is indent to the end of the file.

The >G doesn't need a trailing > to commit the command as the G command is a terminating command already.

share|improve this answer

If you want to abbreviate this, you can create a macro that indents just the current line or some other preset value. For example:map <tab> >1>

share|improve this answer

I use>} to indent a paragraph (a chunk of code up to the next empty line)

share|improve this answer

If you want to indent a line say 3 levels, you can use the "." motion to repeat the last action after indenting.

Eg:

>>..
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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