vim:左对齐当前行的连续行

Kev*_*son 10 vim indentation

很多时候,当我粘贴到vim中时,我会得到级联的缩进,这些缩进非常令人沮丧.结果看起来像这样

This is line one
    This is line two
        This is line three
            This is line four
Run Code Online (Sandbox Code Playgroud)

我想知道是否有办法告诉vim将第二行到第四行与第一行对齐.如果第一行文本从光标位置6开始,有没有办法说"让接下来的十行也从第6位开始?"

pb2*_*b2q 13

要更正此级联缩进,可以使用重新缩进块=.选择一个可视块并键入=或提供一个动作:=4j重新缩进接下来的4行.

您可以通过paste在粘贴前设置来避免级联缩进::set paste.粘贴后:set nopaste.