How to make vim pathogen to reload plugins?
Asked Answered
S

3

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.

Sawfly answered 17/1, 2014 at 13:33 Comment(0)
T
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
Telles answered 17/1, 2014 at 13:52 Comment(1)
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.Ringtail
C
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

Connelley answered 6/5, 2019 at 15:51 Comment(0)
E
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.

Eunaeunice answered 5/10, 2016 at 1:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.