vimvim-pluginpathogen

pathogen not loading plugins in GVIM


I'm having trouble using pathogen with GVIM on Windows 10.

So far, I've installed GVIM in C:/Program Files (x86)/, vim-pathogen in C:/Program Files (x86)/Vim/vimfiles/autoload and my plugins in C:/Program Files (x86)/Vim/vimfiles/bundle.

I've renamed the standard _vimrc to vimrc_original, so it goes undetected (excerpt):

source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

set diffexpr=MyDiff()
function MyDiff()
  (<definition of function ...>)

I've placed a custom .vimrc in my user directory C:/Users/User (~\), which is detected by GVIM (excerpt):

set langmenu=en_US
let $LANG = 'en_US'

colorscheme industry

execute pathogen#infect()
filetype plugin indent on

syntax on

"<(non relevant part) ...>

On invoking :scriptnames, however, none of my plugins in C:/Program Files (x86)/Vim/vimfiles/bundle are listed; only the scripts in GVIM's runtime folder C:/Program Files (x86)/Vim/vimM80/:

  1: ~\.vimrc
  2: C:\Program Files (x86)\Vim\vim80\colors\industry.vim
  3: C:\Program Files (x86)\Vim\vimfiles\autoload\pathogen.vim
  4: C:\Program Files (x86)\Vim\vim80\filetype.vim
  5: C:\Program Files (x86)\Vim\vim80\menu.vim
  6: C:\Program Files (x86)\Vim\vim80\autoload\paste.vim
  7: C:\Program Files (x86)\Vim\vim80\ftplugin.vim
  8: C:\Program Files (x86)\Vim\vim80\indent.vim
  9: C:\Program Files (x86)\Vim\vim80\syntax\syntax.vim
  10,11: (other syntax files)
 12: C:\Program Files (x86)\Vim\vim80\plugin\getscriptPlugin.vim
 13-22: (other plugin files)
 23: C:\Program Files (x86)\Vim\vim80\plugin\zipPlugin.vim

Why aren't my custom plugins C:/Program Files (x86)/Vim/vimfiles/bundle loaded by pathogen, instead of only the ones in GVIM's runtime folder C:/Program Files (x86)/Vim/vimM80/?

As a test, I am not able to open NERDTree, but my keymap for it works; .vimrc is detected but not the plugin.

Note.

I have already tried following the steps mentioned in this guide, to no avail. The only difference being that I've installed GVIM in Program Files, instead of my home folder, which shouldn't be relevant for my case.

Update

On seeing the result of set runtimepath?:

runtimepath=~/vimfiles,~\vimfiles\bundle\ale,~\vimfiles\bundle\ctrlp.vim,~\vimfiles\bundle\jscheck,~\vimfiles\bundle\neosnippet.vim,~\vimfiles\bundle\nerdtree,~\vimfiles\bundle\omnisharp-vim,~\vimfiles\bundle\tlib_vim,~\vimfiles\bundle\tsuquyomi,~\vimfiles\bundle\typescript-vim,~\vimfiles\bundle\vim-addon-mw-utils,~\vimfiles\bundle\vim-airline,~\vimfiles\bundle\vim-dispatch,~\vimfiles\bundle\vim-markdown,~\vimfiles\bundle\vim-snipmate,~\vimfiles\bundle\vimproc.vim,~\vimfiles\bundle\YouCompleteMe,C:\Program Files (x86)\Vim/vimfiles,C:\Program Files (x86)\Vim\vim80,C:\Program Files (x86)\Vim/vimfiles/after,~/vimfiles/after

I guess pathogen is working after all. But I don't understand why the plugins are not accessable. If the plugins are in Vim's runtimepath this means Vim knows where to look for the plugins, as I understand it.


Solution

  • C:\Program Files (x86)\Vim\ is off-limits. Customization is supposed to happen in %USERPROFILE%\vimfiles and nowhere else:

    %USERPROFILE%\vimfiles\vimrc                    <-- your vimrc
    %USERPROFILE%\vimfiles\autoload\pathogen.vim    <-- the pathogen script
    %USERPROFILE%\vimfiles\bundle\                  <-- your plugins
    

    See this repo for general advices.