Pathogen 不加载插件
病原体对我不起作用。我遵循 Adam Lowe 在此处发布的提示 (还有更多)没有任何成功...
我的 vimrc:
filetype off
call pathogen#runtime_append_all_bundles()
filetype plugin indent on
set nocompatible
syntax on
set tabstop=2
set smarttab
set shiftwidth=2
set autoindent
set expandtab
set number
colorscheme darkblue
.vim 的内容 - ls .vim/*
:
.vim/autoload:
pathogen.vim
.vim/bundle:
nerdcommenter/ vim-haml/ vim-surround/
vim-endwise/ vim-rails/ vim-vividchalk/
捆绑包中的所有插件都是通过将它们从 GitHub 克隆到捆绑包目录中来安装的。
我尝试过病原体 1.1 和 1.2,甚至 GitHub 上的最新版本,但没有任何结果。 Vividchalk、Vim-rails 和 nerdcommenter 无法正常工作。我对其他插头的经验很少,所以我不确定它们,但我想它们也不起作用。
我使用的是ArchLinux,vim 7.2.385-1(不是最新的,因为最新的需要我安装ruby1.9,但它仍然是7.2)。它是通过 pacman - ArchLinux 包管理器安装的。除了使用病原体之外,没有以其他方式安装 vim 插件(我什至通过清理 /usr/share/vim
重新安装了 vim 软件包)。
我做错了什么?
编辑:
/etc/vimrc
http://hpaste.org/fastcgi/hpaste.fcgi/view?id=29685#a29685/usr/share/vim/vimfiles/archlinux.vim
http://hpaste.org/fastcgi/hpaste.fcgi/view?id=29686# a29686
Pathogen does not work for me. I am following Adam Lowe's hints posted here (and few more) without any success...
My vimrc:
filetype off
call pathogen#runtime_append_all_bundles()
filetype plugin indent on
set nocompatible
syntax on
set tabstop=2
set smarttab
set shiftwidth=2
set autoindent
set expandtab
set number
colorscheme darkblue
Contents of .vim - ls .vim/*
:
.vim/autoload:
pathogen.vim
.vim/bundle:
nerdcommenter/ vim-haml/ vim-surround/
vim-endwise/ vim-rails/ vim-vividchalk/
All plugins in bundle were installed by cloning them from GitHub into bundle directory.
I have tried with pathogen 1.1 and 1.2 and even the latest from GitHub without any result. Vividchalk, Vim-rails and nerdcommenter are not working. I have very little experience with other plugs so I am not sure about them, but I suppose they are not working too.
I am using ArchLinux, vim 7.2.385-1 (not the latest because the latest requires me to install ruby1.9, but it is still 7.2). It has been installed via pacman - ArchLinux package manager. No vim plugins were installed the other way than using pathogen (I have even reinstalled vim package with cleaning /usr/share/vim
).
What am I doing wrong?
EDIT:
/etc/vimrc
http://hpaste.org/fastcgi/hpaste.fcgi/view?id=29685#a29685/usr/share/vim/vimfiles/archlinux.vim
http://hpaste.org/fastcgi/hpaste.fcgi/view?id=29686#a29686
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(19)
我遇到了同样的问题,通过将此文件复制到 ~/.vim/autoload 解决:
https://github.com/sontek/dotfiles/blob/master /_vim/autoload/pathogen.vim
i had the same problem , solved by copying this file into ~/.vim/autoload:
https://github.com/sontek/dotfiles/blob/master/_vim/autoload/pathogen.vim
我遇到了同样的问题,最终经过大量谷歌和调整 vimrc 文件,找到了解决方案。希望下面的代码片段能够解决这个问题。
<代码>
设置 nocp
source /home/ameet/.vim/autoload/pathogen.vim "我的 Pathogen.vim 的位置
调用病原体#infect()
调用病原体#helptags()
I was facing the same issue, finally after lot of google and tweaking the vimrc file, found the solution. Hope the following code snippet would resolve the issue.
set nocp
source /home/ameet/.vim/autoload/pathogen.vim "location of my pathogen.vim
call pathogen#infect()
call pathogen#helptags()
为了完整起见,我将添加此问题的解决方案。
我刚刚将 ~/.gvimrc 文件重命名为 ~/.vimrc,所有问题都解决了。我从 Linux 复制了 .vim 和 .gvimrc 并进行了此更改,一切都按预期工作。
For the sake of completion I'll add my solution for this problem.
I just renamed my ~/.gvimrc file to ~/.vimrc, and all my problems were solved. I literally copied my .vim and my .gvimrc from linux and did this change and everything works as expected.
我也有同样的问题。我尝试了所有可能的组合。
最后我发现,如果我使用 mksession 保存我的 Vim 工作区并在 Vim 启动时加载它,它会使 Pathogen 无法加载我放入捆绑文件夹中的新插件。
安装新插件后,我现在总是删除会话文件并重新启动 Vim,并且每个插件都加载良好。
I had the same problem. I tried every possible combination.
Finally I found that if I use
mksession
to save my Vim workspace and have it load on Vim startup, it made pathogen not load new plugins I put into the bundle folder.After installing a new plugin I now always delete my session file and start Vim fresh and every plugin loads fine.
就我而言,我克隆到文件夹 ~/dotfiles 但 vun 查找文件夹 ~/.vim,因此他没有携带任何插件或配色方案来解决我这样做的问题:
In my case I cloned to a folder ~/dotfiles but vun looks for a folder ~/.vim, as a result he carried no plugins or color schemes to solve the problem I did this:
我把它放在我的里面:
I have it in mine as:
在花了太长时间试图用 nerd-commenter/pathogen 解决这个问题之后,我崩溃了,只使用了 Debian 操作系统提供的 nerd-commenter 插件:
如果你使用 Debian 并且需要重新开始工作,请尝试一下。如果您还没有安装“vim-addon-manager”和“vim-scripts”软件包,您可能需要从 apt 安装它们。
After spending waaaay too long trying to solve this problem with nerd-commenter/pathogen, I broke down and just used Debian's OS provided nerd-commenter plugin:
If you're on Debian and need to get back to work, try it out. You probably need "vim-addon-manager" and "vim-scripts" packages installed from apt if you don't have it already.
上面的内容帮助我解决了这个问题,无法对其他人发表评论,但是感谢您发布上面的代码。
The above helped me fix the issue, can't leave a comment on other peoples however thank you for posting the code above.
我在 Ubuntu 上也遇到了同样的问题。日志是:
解决方案是在文件 /usr/share/vim/vim73/ftoff.vim 的末尾添加“\n”以正确执行它。
I was having the same problem with Ubuntu. The log was:
The solution was to add "\n"s at the end from file /usr/share/vim/vim73/ftoff.vim to execute it properly.
我使用了
callpathogen#infect('~/.vim/bundle')
而不是callpathogen#runtime_append_all_bundles()
,它对我有用。Instead of
call pathogen#runtime_append_all_bundles()
, I usedcall pathogen#infect('~/.vim/bundle')
and it worked for me.尝试使用命令检查您的运行时路径:
:设置运行时路径?
第一个条目应该类似于 ~/.vim。
我不加载插件/病原体的问题是我将 vim 环境放置在 ~/.dotfiles/vim 中,我的 vimrc 和其余内容(插件等)所在的位置。
在 ~/.vimrc 中创建到 ~/.dotfiles/vim/vimrc 的符号链接后,我忘记创建第二个符号链接 ~/.vim -> ~/.dotfiles/vim/ 这导致 vim 感到困惑,因为他正在 ~/.vim (默认)中寻找东西。在我制作了正确的符号链接后,所有内容都弹出在正确的位置。
我希望它能帮助像我一样忘记第二个符号链接的人;-)
Try to check your runtime path using command:
:set runtimepath?
First entry should be something like ~/.vim.
My problem with not loading plugins/pathogen was that i placed my vim environment in ~/.dotfiles/vim where my vimrc and rest of the stuff (plugins etc.) lives.
After creating symlink to ~/.dotfiles/vim/vimrc in ~/.vimrc i forgot to make second symlink ~/.vim -> ~/.dotfiles/vim/ which caused vim to be confused cause he was looking for stuff in ~/.vim (default). After i made proper symlink everything poped in right place.
I hope it will help someone who forgot about second symlink like I did ;-)
通过 github 提出问题后由 (mattn & tpope) 修复,
请参阅 https:/ /github.com/tpope/vim-pathogen/issues/50#issuecomment-3137909
Fixed by (mattn & tpope) after raising issue via github
see https://github.com/tpope/vim-pathogen/issues/50#issuecomment-3137909
我的环境是Vim 7.3.35和Ubuntu 11.04。
我花了一些时间试图解决它。我克隆项目 https://github.com:r00k/dotfiles 并按照说明进行安装。
当启动 vi 时,得到了这样的评论
及解决方案:
不起作用。
我在我的主目录中发现了 .vim 符号链接,但没有正确设置。安装脚本创建了一个 .vim 目录,其中有一个符号链接 vim 指向我的 .dotfiles/vim。解决方案是删除 .vim 目录并创建一个指向 .dotfiles/vim 的符号链接 .vim。
A 还在我的 .vimrc 中关闭/打开文件类型。
My environment is Vim 7.3.35 and Ubuntu 11.04.
I spent some time trying to resolve it. I clone the project https://github.com:r00k/dotfiles and follow the instructions to install.
When started vi a got the so commented
and the solution:
did not work.
I found the .vim symlink in my home directory where no properly set. The install script made a .vim DIRECTORY with a symlink vim inside of it pointing to my .dotfiles/vim. The solution was to delete the .vim directory and make a symlink .vim pointing .dotfiles/vim.
A kept the filetype off/on in my .vimrc also.
也许 Arch 的默认 vimrc (可能是
/etc/vim/vimrc
)与 Pathogen 不能很好地配合。尝试在不加载配置文件的情况下启动 Vim:然后从 vim 中加载 vimrc:
那么插件可以工作吗?
Maybe Arch's default vimrc (possibly
/etc/vim/vimrc
) doesn't play well with Pathogen. Try starting Vim without loading config files:and then load your vimrc from within vim:
Do the plugins work then?
如果您的 .vim 基于 git 存储库和子模块,请记住在克隆存储库后运行 git submodule init 和 git submodule update 。即
我遇到了同样的错误并尝试了上述所有方法,但它不起作用。直到我初始化并更新了 git 子模块。
希望这对遇到类似错误的人有所帮助。
If your .vim is based on a git repo and submodules, DO REMEMBER to run
git submodule init
andgit submodule update
after cloning the repo. i.e.I had the same error and tried all of the above, but it didn't work. Until I initialized and updated the git submodules.
Hope this helps for anyone who has a similar error.
这似乎是由某些发行版中的“系统”vimrc 在设置病原体之前设置
filetype on
引起的常见问题。因此,将其关闭并再次打开会强制插件正确加载:更多信息 这里。
This seems to be common problem caused by the "system" vimrc in some distributions setting
filetype on
before you set up pathogen. So turning it off and back on again forces plugins to load correctly:More info here.
我也有类似的问题。 Pathogen 正在加载我的一些插件,但不是全部。
经过一番摆弄和思考后,我发现(我不知道文档中是否提到)在每个
bundle/'plugin_name'
文件夹中,应该有另一个名为plugin
的文件夹> 包含 *.vim 文件。然后,当 vim 启动时,将不在捆绑包中查找,而是在捆绑包内包含名为插件的文件夹的文件夹中查找,并将创建其他文件夹(在每个插件文件夹中)。
因此,如果插件只是一个 .vim 文件,请为其创建一个文件夹...
而不是:
您需要:
一切都像魅力一样。
I was having a similar problem. Pathogen was loading some of my plugins while not all of them.
After some fiddling and wondering I discovered (I don't know if it's mentioned in the documentation) that in each
bundle/'plugin_name'
folder, there should be another folder calledplugin
that contains the *.vim file.Then, when vim starts will look, not in bundle, but in those folders within bundle that contain a folder called plugin... and will create other folders (in each plugin folder).
So, if the plugin is just a .vim file make a folder for it...
instead of:
you need:
And everything works like a charm.
我在加载特定插件时遇到问题:特别是带有
plugin
子目录的插件。例如,在新安装的 MacVim 上,~/.vim/bundle/surround/plugin/surround.vim
中的插件没有被加载,即使~/.vim/bundle /surround
出现在:scriptnames
的输出中。问题是我在
.gvimrc
中加载 Pathogen,而不是.vimrc
。无论出于何种原因,如果您这样做,.vim/bundle/*/plugin
子目录中的内容将不会加载,因此请在.vimrc
中执行!我已经在 github 上打开了一个问题——我不知道它是否可以工作如果它是从
.gvimrc
加载的,但是对于像我这样的白痴来说,文档中至少应该有某种警告。I've had problems loading particular plugins: specifically, plugins with a
plugin
subdirectory. For example, on a fresh MacVim install, a plugin in~/.vim/bundle/surround/plugin/surround.vim
wasn't being loaded, even though~/.vim/bundle/surround
appeared in the output of:scriptnames
.The problem was that I was loading Pathogen in
.gvimrc
, not.vimrc
. For whatever reason, stuff in.vim/bundle/*/plugin
subdirectories won't load if you do that, so do it in.vimrc
!I've opened an issue on github—I don't know if it can be made to work even if it loads from
.gvimrc
, but there should at least be some sort of warning in the documentation for idiots like me.