我正在尝试使用Pathogen来管理Vim插件。我有几个用.vim/ftplugins写的脚本。
我安装了病原体,但现在ftplugins中的脚本都不运行了。
我尝试使用脚本在.vim/bundle中添加一个目录,但它不起作用(它是.vim/bundle/local/ftplugin/python.vim)
你知道如何让病原体加载ftplugin目录中的脚本吗?
我的.vimrc的前几行
set nocompatible
syntax on
filetype plugin indent on
"execute pathogen#infect()仅适用于已注释掉的行。
我在Bash提示符下运行gvim,第一个参数是filename,如下所示:
$ gvim some/path/somefile.py我希望看到的文件具有我在~/.vim/ftplugin/python.vim中定义的Python文件的预定义配色方案以及该脚本中定义的所有其他设置。
~/.vim/bundle目录为空。
病原体在~/.vim/autoload中,没有其他内容。
$ ls ~/.vim/ftplugin/
css.vim html.vim javascript.vim python_pep8.vim python_pyflakes.vim python.vim rst.vim xml.vim
$ ls ~/.vim
autoload bundle colors doc ftdetect ftplugin plugins ScrollColor.vim spell syntax发布于 2013-01-11 23:43:41
这是文件类型检测的问题,这是Pathogen issue。
在我的例子中,工作很简单,使用下面的代码来启用病原体:
set nocompatible
"execute pathogen#infect() " breaks filetype detection
call pathogen#runtime_append_all_bundles()
filetype plugin indent on
syntax on我所做的是删除我的~/.vim目录,并从一个干净的目录开始。一个接一个地添加内容并检查结果。我意识到它没有检测到正确的文件类型(当我打开一个空文件时,检测是可以的,但当我打开一个已有的文件时,就不是这样了)。
发布于 2013-01-11 04:47:07
将我的评论放在这里:
想知道如果您将:filetype和:syntax调用放在:execute之后是否有效?官方README建议在第二部分中这样做:第一个:execute,第二个:syntax,第三个:filetype。注意:不要像@Eduan建议的那样在:execute之前禁用文件类型,只是在调用:execute之前不要启用它:
set nocompatible
execute pathogen#infect()
syntax on
filetype plugin indent on顺便说一句,never use *map。
发布于 2013-01-11 03:39:46
我想我能理解您的问题,为了示例代码的清晰度,将它放在答案中而不是注释中。
试试这个:
" Set the filetype stuff to off, required for Pathogen
filetype off
filetype plugin indent off
execute pathogen#infect()
" You can now turn it on again
filetype on
filetype plugin indent on而不是您当前的设置。
https://stackoverflow.com/questions/14264372
复制相似问题