Pathogen does not load plugins

45,606

Solution 1

This seems to be common problem caused by the "system" vimrc in some distributions setting filetype on before you set up pathogen. So turning it off and back on again forces plugins to load correctly:

 call pathogen#runtime_append_all_bundles()
 filetype off
 syntax on
 filetype plugin indent on

More info here.

Solution 2

I was having a similar problem. Pathogen was loading some of my plugins while not all of them. After some fiddling and wondering I discovered (I don't know if it's mentioned in the documentation) that in each bundle/'plugin_name' folder, there should be another folder called plugin that contains the *.vim file.

Then, when vim starts will look, not in bundle, but in those folders within bundle that contain a folder called plugin... and will create other folders (in each plugin folder).

So, if the plugin is just a .vim file make a folder for it...

instead of:

~/.vim/bundle/vimexplorer/vimExplorer.vim

you need:

~/.vim/bundle/vimexplorer/plugin/vimExplorer.vim

And everything works like a charm.

Solution 3

I've had problems loading particular plugins: specifically, plugins with a plugin subdirectory. For example, on a fresh MacVim install, a plugin in ~/.vim/bundle/surround/plugin/surround.vim wasn't being loaded, even though ~/.vim/bundle/surround appeared in the output of :scriptnames.

The problem was that I was loading Pathogen in .gvimrc, not .vimrc. For whatever reason, stuff in .vim/bundle/*/plugin subdirectories won't load if you do that, so do it in .vimrc!

I've opened an issue on github—I don't know if it can be made to work even if it loads from .gvimrc, but there should at least be some sort of warning in the documentation for idiots like me.

Solution 4

If your .vim is based on a git repo and submodules, DO REMEMBER to run git submodule init and git submodule update after cloning the repo. i.e.

git submodule init
git submodule update

I had the same error and tried all of the above, but it didn't work. Until I initialized and updated the git submodules.

Hope this helps for anyone who has a similar error.

Solution 5

Maybe Arch's default vimrc (possibly /etc/vim/vimrc) doesn't play well with Pathogen. Try starting Vim without loading config files:

vim -u NONE

and then load your vimrc from within vim:

:so ~/.vimrc

Do the plugins work then?

Share:
45,606
skalee
Author by

skalee

Updated on July 09, 2022

Comments

  • skalee
    skalee almost 2 years

    Pathogen does not work for me. I am following Adam Lowe's hints posted here (and few more) without any success...

    My vimrc:

    filetype off
    call pathogen#runtime_append_all_bundles()
    
    filetype plugin indent on
    set nocompatible
    syntax on
    set tabstop=2
    set smarttab
    set shiftwidth=2
    set autoindent
    set expandtab
    set number
    colorscheme darkblue
    

    Contents of .vim - ls .vim/*:

    .vim/autoload:
    pathogen.vim
    
    .vim/bundle:
    nerdcommenter/  vim-haml/   vim-surround/
    vim-endwise/    vim-rails/  vim-vividchalk/
    

    All plugins in bundle were installed by cloning them from GitHub into bundle directory.

    I have tried with pathogen 1.1 and 1.2 and even the latest from GitHub without any result. Vividchalk, Vim-rails and nerdcommenter are not working. I have very little experience with other plugs so I am not sure about them, but I suppose they are not working too.

    I am using ArchLinux, vim 7.2.385-1 (not the latest because the latest requires me to install ruby1.9, but it is still 7.2). It has been installed via pacman - ArchLinux package manager. No vim plugins were installed the other way than using pathogen (I have even reinstalled vim package with cleaning /usr/share/vim).

    What am I doing wrong?

    EDIT:

  • skalee
    skalee over 13 years
    I am getting error E117 that pathogen#runtime_append_all_bundles and pathogen#helptags are unknown functions. Loading pathogen with :so .vim/autoload/pathogen.vim before loading .vimrc does not help. Commenting everything in /etc/vimrc does not help. Substituting /etc/vimrc with standard example vimrc does not help. Thanks for your effords.
  • Conceited Code
    Conceited Code over 13 years
    Did you ever figure out how to fix it? I have the same problem now using Ubuntu.
  • Ramon Tayag
    Ramon Tayag over 13 years
    Yeah I have the same problem too. Installed github.com/akitaonrails/vimfiles. On Ubuntu 10.10. gVim 7.2.330
  • Christian Joudrey
    Christian Joudrey about 13 years
    I'm having the same problem under Ubuntu 10.10. Anyone get it working?
  • Christian Joudrey
    Christian Joudrey about 13 years
  • Araxia
    Araxia over 12 years
    call pathogen#infect() which can be used in the latest version of pathogen now deals with this filetype problem (and is much easier to remember and type than runtime_append_all_bundles).
  • Alfa07
    Alfa07 about 12 years
    Changing from _gvimrc to .vimrc fixed mine problem! Thank you!
  • Mike
    Mike about 12 years
    Moving these lines from .gvimrc to .vimrc got it working for me. call pathogen#infect() filetype plugin indent on
  • Dilawar
    Dilawar almost 11 years
    I suspect the runtime_append_all_bundle no longer exists in pathogen. You should change it to incubate. Or use infect as suggested by @Araxia .
  • BlueBomber
    BlueBomber almost 11 years
    This was exactly my problem: The plugin source tree contained a directory called 'ftplugin'. I just created a symlink to it called 'plugin' and now everything works as expected.
  • Joseph K. Strauss
    Joseph K. Strauss almost 9 years
    Had the same problem in Git for Windows after switching from Git Bash. Git Bash had the files in ~/vimfiles. Changed the name to ~/.vim, and it works.
  • xdhmoore
    xdhmoore about 8 years
    same with other kinds of plugins like colorschemes. They require a colors folder, mirroring the $VIM/vimfiles directory. Pathogen works by adding each plugin root folder to Vim's runtimepath setting, which Vim then traverses looking for layouts that it expects in '$VIM/vimfiles'
  • Harshiv
    Harshiv over 6 years
    @Christian Joudrey, the link you gave is dead.
  • Shawn
    Shawn almost 6 years
    As un-related as this looks to vim, if you used git to add the vim plugins as submodules, a clean init and update is the only way to proceed. Even if you already have a copy of the directories in place from a previous installation.