我对VIM还比较陌生,一直在使用bundle来格式化/着色/缩进我的文件。我最近从这里下载了一个typescript vim语法的“bundle”:https://github.com/leafgarland/typescript-vim.git,问题是缩进对我来说似乎有问题,考虑以下示例,在自动缩进(gg=G)文件后:
module Module {
class Foo {
// some string here
bar: string; // bar is incorrectly indented
}
}
实际上我期望以下结果:
module Module {
class Foo {
// some string here
bar: string; // bar is correctly indented
}
}
这是typescript.vim ftplugin文件:
compiler typescript
setlocal autoindent
setlocal cindent
setlocal smartindent
setlocal indentexpr&
setlocal commentstring=//\ %s
我尝试了不同的缩进设置,但都没有成功。我使用的是这里的VIM设置和捆绑包: https://github.com/gisenberg/.vim,我使用git在本地同步这些文件。
TIA!
bar:
是标签的语法,不应该有缩进。 - Swiss