If you've already selected the four lines in visual mode: >
will shift them shiftwidth
to the right. After they are shifted, the visual selection will be gone, but you can indent again via .
(repeat last command).
If you are normal mode, with your cursor anywhere on the first line:
>>
will indent that line,
4>>
will indent all four lines,
>3j
will do the same thing in a different way (indent from this line to three lines down),
>}
will indent all of the lines until the end of the paragraph (i.e. to the first empty line, see :help object-motions
), and
>ap
will indent all of the lines for a p-aragraph (see :help text-objects
), even if your cursor isn't on the first line.
Again, you can repeat these commands via .
for deeper indentation levels (or you can set shiftwidth
appropriately).
If your file is nicely composed of "paragraphs" (and most of my code and prose is), I think you'll find the ap
text-object to be the most common way to work on blocks of text like this. You can also use text-objects
to speed up visual selection.