Many times I run across a situation where a line is not indented properly. Ether through a paste, bad / not preferred indent plugin, or most often extra spaces offsetting the indent value. I usually fix this by <<
or >>
the line a few times to fix it up. In the case of extra spaces I'll do a 100<<
then a >>
for each indent level I actually want.
The question is, like the | motion that lets you set the column by number 10|
sends the cursor to the 10th column. How can I specify the indent level?
An example (this does not work) with shiftwidth=4 expandtab
:
The quick (indent level 0)
••••Brown Fox (indent level 1)
••••••••••Jumped over the lazy dog (indent level 2 with two extra spaces)
In this case I currently have to count the indent level of the last line (2) and add one for the extra spaces then type 3<<
then count the indent level of what I then 1>>
(or use autoindent
and ==
command).
I'm asking for something like 1==
to force the indent to be indent level 1. Or in some cases 0==
for removing an indent all together.
I realize the above example does auto indenting on 1 or 0 lines (respectively) and so does not do what I'd like but hoped it would help illustrate the question better.