Okay, I’ll admit, I’ve been living in the vi darkages. Up until just now, whenever I wanted to fix the indention of several lines in some file I am coding up, I manually went through some keyboard gyrations to get the job done.
Today, I was finally fed up with that and within minutes found some good solutions for this problem.
Do you want to indent some lines one tab stop?
The “>” operator in command mode is used to indent lines.
To indent multiple lines, combine the “>” operator with a number prefix
10>> #this indents the line you are on and the next 9
or a movement command
>}
will indent to the next blank line.
With your cursor on an open paren “(”, then
>%
will indent the lines up to and including the matching closing paren.
If you don’t want to count lines, you could set a mark, do some movement
and indent back to the mark:majjjj>’a #the j is used for illustration, it could be any other movement
or indent up to a line with a search pattern in it:
>/pattern[enter]







Recent Comments