为什么 VIM 没有检测到我的 coffescript 文件类型?
我正在尝试使用 vim-coffee-script 插件 https://github.com/kchmck/vim-coffee-script 但它没有将测试文件检测为咖啡脚本文件类型。但是,当我手动执行它时,
:set ft=coffee
它会起作用。这是怎么回事?
.vimrc 和 test.coffee https://gist.github.com/911087
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 and test.coffee https://gist.github.com/911087
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我想通了..我必须通过设置强制重新加载文件类型
具体来说,我必须在运行后执行此操作
这主要在病原体自述文件
http://www.vim.org/scripts/script.php?script_id=2332
I figured it out.. I had to force reloading of the filetype by setting
Specifically, I had to do this AFTER running
This is mostly explained in the pathogen readme
http://www.vim.org/scripts/script.php?script_id=2332
诺利的解决方案有时对我有用。在其他时间或对于其他文件类型,它会崩溃。这让我很生气。
解决方案是将
syntax enable
移动到vimrc的底部。说明:按照 noli 的逻辑,我查看了 Github 上的病原体文档。有件事引起了我的注意,
安装插件之后一切都会打开。我注意到我的 vimrc 中并非如此,因此我将
syntax
和filetype
移到了 vimrc 的底部。问题已解决(到目前为止)Noli's solution worked for me sometimes. At other times or for other filetypes, it broke. This was infuriating me.
The solution is to move
syntax enable
to the bottom of vimrc.Explanation: Following noli's logic a little further, I checked out the pathogen docs on Github. One thing caught my eye
Everything is turned on after plugins are installed. I noticed this wasn't the case in my vimrc, so I moved
syntax
andfiletype
to the bottom of my vimrc. Problem solved (so far)我在这里尝试了所有建议的解决方案,但没有人适合我。对我有用的解决方案是将以下片段添加到
~/.vimrc
文件中并解决问题。
I tried all the proposed solutions here, but no one worked for me. The solution that worked for me is to add the following snippit to the
~/.vimrc
fileand problem solved.