Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 335
xliiv Avatar asked Jan 17 '14 13:01

xliiv


People also ask

How do you get pathogens in Vim?

Place pathogen. vim inside ... \vim\vimfiles\autoload and you should be good to go. Bundles and pathogen should go to user's own vim configuration directory which is by default in {Disk}:/Users/{User}/vimfiles or {Disk}:/Documents and Settings/{User}/vimfiles .

What is pathogen in Vim?

vim-pathogen is a runtimepath manager created by Tim Pope to make it easy to install plugins and runtime files in their own private directories.

Does vim have a built in plugin manager?

Vim 8 has a built-in plugins support using packages ( :h packages ). This post will show you how to install plugins using packages.

How do I find my vim plugins?

Now you can place Vim plugins in ~/. vim/pack/vendor/start, and they'll automatically load when you launch Vim. A file tree will open along the left side of your Vim window. Any plugins installed into opt are available to Vim, but they're not loaded into memory until you add them to a session with the packadd command.


1 Answers

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
like image 94
Ingo Karkat Avatar answered Sep 21 '22 03:09

Ingo Karkat