未知函数:pathogen#infect

12

我刚刚安装了MacVim(并覆盖了Vim)。我正在尝试让Pathogen工作。当我启动Vim时,我会得到以下错误:

Error detected while processing /Users/nir/.vim/autoload/pathogen.vim:
line    1:
E477: No ! allowed: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
line    2:
E488: Trailing characters: <html><head>
line    3:
Press ENTER or type command to continue

E488: Trailing characters: <title>302 Found</title>
line    4:
E488: Trailing characters: </head><body>
line    5:
E488: Trailing characters: <h1>Found</h1>
line    6:
E488: Trailing characters: <p>The document has moved <a href=
line    7:
E488: Trailing characters: <hr>
line    8:
E488: Trailing characters: <address>Apache/2.2.22 (Debian) Server at tpo.pe Port 443</address>
line    9:
E488: Trailing characters: </body></html>
line    1:
E477: No ! allowed: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
line    2:
E488: Trailing characters: <html><head>
line    3:
E488: Trailing characters: <title>302 Found</title>
line    4:
E488: Trailing characters: </head><body>
line    5:
E488: Trailing characters: <h1>Found</h1>
line    6:
E488: Trailing characters: <p>The document has moved <a href=
line    7:
E488: Trailing characters: <hr>
line    8:
E488: Trailing characters: <address>Apache/2.2.22 (Debian) Server at tpo.pe Port 443</address>
line    9:
E488: Trailing characters: </body></html>
Error detected while processing /Users/nirchernia/.vimrc:
line    1:
E117: Unknown function: pathogen#infect
E15: Invalid expression: pathogen#infect()

我的 .vimrc 文件看起来像这样

execute pathogen#infect()
syntax on
filetype plugin indent on

我的目录长这样

~/
  .vimrc
  .vim
     autoload
       pathogen.vim
     bundle
       nerdtree
  .viminfo
3个回答

39

看起来你直接从浏览器复制了pathogen.vim文件,其中包含所有的HTML标签。

尝试运行以下命令,然后再试一次 -

curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

更多关于Pathogen安装的信息。


1
谢谢,这个方法起作用了,但是我不明白为什么它会提取HTML标签? - ApathyBear
2
取决于你复制文件的方式。最有可能的情况是,在浏览器中选择了显示有一些语法高亮的页面上的所有内容。 - ronakg
当更新脚本破坏了我的病原体安装时,这对我很有用。重新安装! - bloke_zero
检查在执行curl时是否在代理后面。如果无法下载,请手动复制并粘贴到autoload目录中。 - alfonzjanfrithz
那没帮助 :( - Liker777

2

已经发布并被接受的答案可能对最初的问题是正确的。

今天我遇到了同样的问题,但被接受的答案没有解决它。经过调查,似乎资源已经移动(可能是暂时的),现在位于一个无效的SSL证书后面。

以下内容对我有用:

curl --insecure -LSso ~/.vim/autoload/pathogen.vim https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim

1
谢谢您 - 似乎有一段时间只有Unix用户才能使用pathogen! - Chris Hopkins
由于某些原因,那对我不起作用了... - Liker777
@Liker777 它是否抛出了错误或其他任何异常? - wally
1
@wally 目前我只是放弃了那个,因为我已经厌倦了解决病原体路径的插头。目前我只是手动安装插件,这样更容易... - Liker777

0

我有同样的问题 "Ubuntu 16.04"

这是解决方案: https://github.com/tpope/vim-pathogen/issues/50

.vimrc:

set nocp " 如果需要,设置rtp+=/path/to/rtp/that/included/pathogen/vim call pathogen#infect() syntax on filetype plugin indent on


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接