本文介绍了VIM为什么未检测到我的文件文件类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用vim-coffee-script插件,但未将测试文件检测为coffeescript文件类型。但是,当我手动进行操作
I'm trying to use the vim-coffee-script plugin https://github.com/kchmck/vim-coffee-script but its not detecting a test file as a coffeescript filetype. However when I do it manually
:set ft=coffee
它起作用。发生了什么事?
it works. What's going on?
.vimrc和test.coffee
.vimrc and test.coffee https://gist.github.com/911087
推荐答案
我发现了这一点。我必须通过设置
I figured it out.. I had to force reloading of the filetype by setting
filetype off
filetype on
具体来说,我必须在运行
Specifically, I had to do this AFTER running
syntax on
这主要在病原体自述文件中得到解释
This is mostly explained in the pathogen readme
http://www.vim.org/scripts/script.php?script_id=2332
这篇关于VIM为什么未检测到我的文件文件类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!