经过大量阅读后,我仍然无法让Pathogen在Windows下加载插件 [英] After much reading, I still can't get Pathogen to load a plugin under Windows

查看:145
本文介绍了经过大量阅读后,我仍然无法让Pathogen在Windows下加载插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于Windows 7 64位完全更新的gVim 7.3.46(我运行gVim 7.3.46是因为它在Windows上下文菜单中添加了用Vim编辑"的可靠实例.)

For gVim 7.3.46 on Windows 7 64-bit fully updated (I run gVim 7.3.46 because it adds a reliable instance of "Edit with Vim" to the Windows context menu.)

尽管已经阅读了大量文章(其中许多重复了其他文章),但我无法让Pathogen加载一个即使不使用Pathogen也能正常工作的vim插件.

Despite having read an abundance of articles (many of them which repeat the others) I can't get Pathogen to load a vim plugin that already works fine if I don't use Pathogen.

问题似乎出在Pathogen的"bundle"文件夹中,如下所示:

The problem seems to be the location of Pathogen's "bundle" folder as follows:

·如果我将mru.vim(最近使用过的文件)插件放在"D:\ Program Files(x86)\ Vim \ vim73 \ plugin"中,则MRU可以正常工作—输入:MRU返回最近的列表用过的文件

· IF I place the mru.vim (Most Recently Used Files) plugin in "D:\Program Files (x86)\Vim\vim73\plugin", THEN MRU works just fine — typing :MRU returns a list of recently used files

.如果我将mru.vim放置在名为"bundle"的文件夹中,然后将bundle文件夹放置在"D:\ Program Files(x86)\ Vim \ vimfiles"或下面列出的其他位置,则键入MRU将返回"E492:不是编辑器"命令:MRU"

. IF I place mru.vim in a folder named "bundle", then place the bundle folder in "D:\Program Files (x86)\Vim\vimfiles", or other locations listed below, typing MRU returns "E492 : Not an editor command : MRU"

我的环境:

·在Windows 7 64位系统中,"D:\ Program Files(x86)\ Vim \ vim73 \ gvim.exe"中安装了Vim/gVim 7.3.46(是,"D"而不是"C")

· In Windows 7 64-bit, Vim / gVim 7.3.46 is installed in "D:\Program Files (x86)\Vim\vim73\gvim.exe" (Yes, "D", not "C").

·在gVIM中,键入:e $ VIM返回以下四行:

· In gVIM, typing :e $VIM returns the following four-lines:

../
vim73/
vimfiles/
_vimrc  

·在"D:\ Program Files(x86)\ Vim \ vimfiles \ autoload \"中,我有病原体.vim. gVim在此位置启动时没有错误,并且键入:pathogen#helptags()不会返回错误(我读过一篇文章,指出该命令是判断Pathogen是否已正确安装的一种方式).

· In "D:\Program Files (x86)\Vim\vimfiles\autoload\", I have pathogen.vim. In this location gVim starts without error, and typing :pathogen#helptags() returns no error (one article I read indicated that command was one way to tell if Pathogen was installed correctly).

·我的_vimrc文件包括以下行:

· My _vimrc file includes the lines:

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

我的问题:

我尝试将包含mru.vim的bundle文件夹复制到:

I've tried copying the bundle folder containing mru.vim to:

·D:\ Program Files(x86)\ Vim \ vimfiles(在Windows中被誉为正确"位置)

· D:\Program Files (x86)\Vim\vimfiles (reputedly the "correct" location for Windows)

·D:\ Program Files(x86)\ Vim

· D:\Program Files (x86)\Vim

·D:\ Program Files(x86)\ Vim \ vim73

· D:\Program Files (x86)\Vim\vim73

多篇文章将该列表中的第一个条目标识为Windows系统中bundle文件夹的正确位置.也就是说,在Windows中,与* ix不同,显然不会将bundle文件夹埋"在* ix .vim文件夹,Windows .. \ users [userName]文件夹或like(?)

Multiple articles identify the first entry in that list as the correct location for the bundle folder in a Windows system. That is to say, that in Windows unlike *ix, one evidently does NOT "bury" the bundle folder somewhere down in the *ix .vim folder, or Windows ..\users[userName] folder, or the like(?)

所有这些捆绑"位置对于键入:MRU都会产生相同的响应-"E492:不是编辑器命令:MRU".

All of those locations for "bundle" produce the same response to typing :MRU — "E492 : Not an editor command : MRU".

我机智.有任何想法吗?

I'm at wits end. Any ideas anyone?

(通过,谢谢,但是我不想使用Vundle/Github/Curl或任何其他与网络相关的解决方案.我并没有使用太多的gVim插件,而我使用的那些插件我想下载并自己复制到bundle文件夹中,而不要进行不需要的网络过程.)

(By the by, thanks but I do NOT want to use Vundle / Github / Curl or any other network related solution. I don't use all that many gVim plugins, and the ones I do use I want to download and copy into the bundle folder myself rather than have an unwanted network process involved in that.)

干杯感谢您的帮助, 赖利 SFO

Cheers & thanks for your help, Riley SFO

推荐答案

mru.vim应该放置在bundle文件夹中,以使路径为

mru.vim should be placed in the bundle folder such that the path is

D:\Program Files (x86)\Vim\vimfiles\bundle\mru\plugin\mru.vim

尽管它实际上应该放在主目录中的vimfiles中,而不是Program Files中.

Although it should really be placed inside vimfiles in your home directory not Program Files

$HOME\vimfiles\bundle\mru\plugin\mru.vim

Pathogen使之如此,以便捆绑软件中的每个文件夹都是vim运行时路径的一部分.这样,bundle文件夹中的每个插件都可以拥有一个干净的环境来存储所有相关文件.

Pathogen makes it so that every folder in bundle is part of the vim runtime path. This allows every plugin in the bundle folder to have a clean environment for it to store all related files.

例如,如果您有两个具有多个文件的插件(例如,它们都随文档一起提供).

For example if you had two plugins that had more than one file (for example they both came with documentation).

然后,vimfiles文件夹的文件结构将如下所示.

Then the file structure of the vimfiles folder would look something like this.

vimfiles/
    plugin/
        plugin1.vim
        plugin2.vim
    doc/
        plugin1.txt
        plugin2.txt

但是,当您想要删除其中一个插件时,会去查找每个文件中的每个文件(并且您可能会错过一些文件)会发生什么.

But what happens when you want to remove one of the plugins you need to go find each and everyone of the files (and you might miss some).

安装了Pathogen后,您的目录结构可能看起来像这样.

With Pathogen installed your directory structure would probably look something like this.

vimfiles/
    bundle/
        plugin1/
            plugin/
                plugin1.vim
            doc/
                plugin1.txt
        plugin2/
            plugin/
                plugin2.vim
            doc/
                plugin2.txt

Pathogen将bundle文件夹下的所有文件夹追加到vim运行时路径.这样一来,vim就可以找到文件,而vim则比别的地方更明智.

Pathogen appends all of the folders under the bundle folder to the vim runtime path. This allows vim to find the files and vim is none the wiser that its not in the usual place.

这也使删除插件更加容易.您无需搜索插件随附的所有文件,只需从捆绑文件夹中删除相关文件夹即可.

This also allows for easier removal of plugins. You don't have to go searching for all the files that came with the plugin you just need to remove the relevant folder from the bundle folder.

仅出于完成目的. (如果您不想这样做,则不需要这样做)

Just for completion sake. (You don't need to do this if you don't want to)

安装.

如果您使用git,现在可以转到github页面上的 vim-scripts 并找到插件你要.由于您对使用mru感兴趣,因此mru插件的链接为 https://github.com/vim -scripts/mru.vim

If you used git you can now go to the github page for vim-scripts and find the plugin you want. Since you were interested in using mru the link to the mru plugin is https://github.com/vim-scripts/mru.vim

现在要安装插件,您只需要进入bundle文件夹并运行

Now to install the plugin you just need to go into the bundle folder and run

git clone https://github.com/vim-scripts/mru.vim

vim脚本存储库中的所有脚本都具有病原体期望的正确结构,因此在运行该命令后,便完成了插件的安装.

All the scripts in the vim scripts repository have the proper structure that pathogen is expecting so after running that one command you are done installing the plugin.

这篇关于经过大量阅读后,我仍然无法让Pathogen在Windows下加载插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆