2012-07-18 72 views
2

我真的使用Vim的我想设置如下图所示如何设置fitetype取决于当前目录?

autocmd BufNewFile,BufRead *_controller.rb set ft=rails syntax=ruby 

而是取决于当前文件目录例如我的文件类型,如果我打开/code/project/app/model/somefile.rb我想设置filetypemodel

现在I` m使用autocmd BufNewFile,BufRead */app/models/*.rb set ft=model syntax=ruby 但也许是更好的选择。

回答

2

这不工作?

autocmd BufNewFile,BufRead */model/*.rb set ft=model