Search code examples
vimpluginsreloadpathogen

How to make vim pathogen to reload plugins?


Is it possible to make vim to reload pathogen plugins without restarting vim? I have opened vim with many files, then I add plugin to:

~/.vim/bundle Since now I'd like to force vim to use the new plugin.


Solution

  • Pathogen just manipulates the 'runtimepath' option; the situation with plugin reloads is therefore the same as with the plain default plugin structure. (Other plugin managers may offer this kind of reload / dynamic enable functionality; I suppose you want to stick with Pathogen.)

    To retroactively enable a plugin in a running Vim session, you need to :source all (usually that's only one) plugin scripts that have been added. For a plugin named foobar, that would be:

    :source ~/.vim/bundle/foobar/plugin/foobar.vim
    

    If you can get Pathogen to re-initialize the 'runtimepath' (or augment it yourself via :set rtp+=~/.vim/bundle/foobar), you can also use the shorter

    :runtime plugin/foobar.vim