如何在vim / gvim中缩进多行?

时间:2012-03-24 10:42:04

标签: vim shortcut

我想在'vim / gvim'中缩进多行,vim / gvim中是否有任何快捷方式?

2 个答案:

答案 0 :(得分:18)

缩进命令=<>可以与all movement commands and text objects结合使用。例如:

>G     Indent until end of file
>}     Indent until next paragraph
>iB    Indent contents of current { } block

它们还缩进在视觉模式中选择的文本。

使用&lt; 取消缩进或 = 重新缩进(使用文件类型设置'格式化')。

答案 1 :(得分:5)

是。尝试:

V             # To switch to visual mode. Select lines, and...
>             # Indent (use `<` to de-indent, or with a number just before to indent several times).
相关问题