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?
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.
If you want to indent a line say 3 levels, you can use the "." motion to repeat the last action after indenting.
Eg:
>>..
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>