17

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.

xliiv
  • 5,399
  • 5
  • 29
  • 35

3 Answers3

21

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
Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
  • 3
    I tried this after installing matchit but it didn't work. I sourced the .vim file in the plugin dir and executed the runtime command. Not sure what I was missing. – justin Apr 13 '14 at 16:01
6

If you use a modern version of vim, you can use its built-in package manager, which has a convenient function to reload all plugins:

:packloadall

http://vimhelp.appspot.com/repeat.txt.html#%3Apackloadall

Llopeth
  • 406
  • 5
  • 11
1

I was in the same boat before util I find an awesome plugin(vim-reload) to do these stuffs automatic in an amazing way.You should have a shot at this plugin.

ResRelentelss
  • 145
  • 1
  • 10