【发布时间】:2013-05-25 23:10:28
【问题描述】:
我在 Vim 中使用 AutoClose 插件。我想设置行为,以便当我处于状态时
while(i < N) {<cursor>}
然后当(且仅当)我按下回车键时,我会:
while(i < N) {
<cursor>
}
这是 Sublime Text 中的行为。
这里有一个类似的问题:Automatically insert a matching brace in Vim 但是用户希望在创建左大括号后立即开始新行。而且它似乎对我来说不能正常工作。
如果我使用它,或者按照@WoLpH 的建议执行set cindent,结果是(只要我创建了左大括号)
while(i < N) {
<cursor>
}
第二个大括号缩进,光标缩进一个空格。我的 vimrc 设置是:
filetype indent on
set ts=4
set sw=4
set et
【问题讨论】: