After much reading, I still can't get Pathogen to load a plugin under Windows

六眼飞鱼酱① 提交于 2019-12-20 05:13:19

问题


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.)

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.

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

· 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

. 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"

MY ENVIRONMENT:

· 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").

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

../
vim73/
vimfiles/
_vimrc  

· 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).

· My _vimrc file includes the lines:

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

MY PROBLEM:

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

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

· D:\Program Files (x86)\Vim

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

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(?)

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?

(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.)

Cheers & thanks for your help, Riley SFO


回答1:


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

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

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

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).

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).

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 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)

Installation.

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

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

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.



来源:https://stackoverflow.com/questions/16366142/after-much-reading-i-still-cant-get-pathogen-to-load-a-plugin-under-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!