Vim:插入或追加缩进

标签 vim

当我通过 Oo 添加一行时,它是根据它周围的缩进添加的。

有没有办法在使用 AI 时做同样的事情?

class
  def method
▋                  | cursor starts in the first column
  end
end

... *clickety-click* ...

class
  def method
    ▋              | cursor is correctly positioned inside the method
  end
end

Oo 开箱即用,但我必须从更高/更低的行开始。

最佳答案

使用 Scc 在正确的缩进级别启动插入模式。

关于Vim:插入或追加缩进,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26298540/

相关文章:

vimdiff 并在左右 Pane 之间移动

c++ - vim 在 ifstream 输入期间文件末尾的新行

vim - 我怎样才能让vim只在空白处换行?

vim:使用 :bn 在缓冲区之间切换时保留光标位置

go - vim 去 : search for function specification rather than the declaration

vim - 在 Linux 上编辑远程文件的快速方法是什么?

git - 在 Vim 中自动包装长 Git 提交消息

vim - 如何在 linuxmint 上为 vim74 安装 nerdtree 插件

performance - Vim 在处理 LaTeX 文件时运行缓慢

linux - 致命的无法找到 https 的远程助手