我在.vimrc中有一些部分,看起来像这样:
@H_301_16@
你可以调用一个函数,如果你喜欢:
autocmd Filetype ruby setlocal ts=2 autocmd Filetype ruby setlocal sts=2 autocmd Filetype ruby setlocal sw=2
现在看来我可以把它们转换为:
autocmd Filetype ruby setlocal ts=2 sts=2 sw=2
但这里是我的问题:有一个vim方式有这样的结构吗?
<something mentioning Filetype ruby> setlocal ts=2 setlocal sts=2 ... <end>
即,可以使用autocmd Filetype位以某种方式解决一组操作? (这是一个简单的例子,我真的要求更复杂的情况。)
autocmd Filetype ruby call SetRubyOptions() function SetRubyOptions() setlocal ts=2 ... endfunction