2

私はVimを使用しています。ファイルタイプを以下のように設定したいと思います。

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

しかし、現在のファイルディレクトリの例に依存します。開いた場合、次の/code/project/app/model/somefile.rbように設定filetypeします。model

今のところ私は使用してautocmd BufNewFile,BufRead */app/models/*.rb set ft=model syntax=ruby いますが、多分より良いオプションです。

4

1 に答える 1

2

これはうまくいきませんか?

autocmd BufNewFile,BufRead */model/*.rb set ft=model
于 2012-07-18T15:04:37.520 に答える