Question

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.

Was it helpful?

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

OTHER TIPS

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

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top