0

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.

easytarget
  • 945
  • 2
  • 13
  • 35
  • Epic fail. So, I copied a bunch of empty directories, which I assumed to have included the relevant files. Like I mentioned in the **update** pathogen was working fine all along. Too bad it doesn't give a warning for empty directories. :) After cloning the relevant git repositories, it worked. – easytarget Apr 22 '18 at 23:46

1 Answers1

1

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.

romainl
  • 186,200
  • 21
  • 280
  • 313
  • So you are saying it is irrelevant that GVim is *installed* in `C:\Program Files (x86)`, the `vimfiles` directory that is detected is the one created in the home directory of the designated user? Or in another way, GVim is supposed to be installed in the home directory of the user; because if it is installed in `C:\Program Files (x86)`, the `C:\Program Files (x86)\Vim\vimfiles` directory, which exists by default, is not usable for some reason? – easytarget Apr 22 '18 at 19:16
  • I'm saying exactly what I'm saying: don't do anything in `C:\Program Files (x86)\Vim\` because that's the system runtime. You are a user so use *your* user runtime: `%USERPROFILE%\vimfiles\`. – romainl Apr 22 '18 at 20:05
  • Okay. I've reinstalled GVim and followed precisely the steps you described. The plugins are still not detected. – easytarget Apr 22 '18 at 20:13
  • Why did you reinstall GVim? – romainl Apr 22 '18 at 20:54
  • No particular reason, I don't know what is causing pathogen to not-load the plugins. I guessed maybe it was due to a faulty installation. I'm going to read the documentation of pathogen to figure out what is going on. – easytarget Apr 22 '18 at 21:26