Reputation: 5106
I want to indent multi-line in 'vim/gvim', is there any shortcut in the vim/gvim?
Upvotes: 13
Views: 15685
Reputation: 111219
The indent commands =
, <
and >
can be combined with all movement commands and text objects. For example:
>G Indent until end of file
>} Indent until next paragraph
>iB Indent contents of current { } block
They also indent text selected in visual mode.
Use < to un-indent or = to re-indent ('format' using the filetype settings).
Upvotes: 20
Reputation: 36262
Yes. Try:
V # To switch to visual mode. Select lines, and...
> # Indent (use `<` to de-indent, or with a number just before to indent several times).
Upvotes: 5