0

Let's say that I've got a package set up like this:

~/.vim/pack/bundle/start/
                         vim-unimpaired/
                         vim-surround/

When Vim starts up, it automatically adds the vim-surround and vim-unimpaired directories to my runtimepath.

While I've got Vim running, let's say that I add the vim-fugitive plugin to the start directory, making my package look like this:

~/.vim/pack/bundle/start/
                         vim-unimpaired/
                         vim-surround/
                         vim-fugitive/

Can I make Vim check the start directory again and add any paths to the runtimepath that are not already present there?

I understand that if I start a new Vim session, then my runtimepath will contain all three plugins. I'm curious to know if there's a way of updating the runtimepath without having to restart Vim.

1

You can use :packloadall!:

Load all packages in the "start" directory under each entry in 'packpath'

[..]

This is normally done automatically during startup, after loading your .vimrc file. With this command it can be done earlier.

[..]

Packages will be loaded only once. After this command it won't happen again. When the optional ! is added this command will load packages even when done before.

There's also the :packadd command, but that will only load from pack/*/opt, not pack/*/start.

  • That does the trick, thanks! I already knew about the :packadd command and I misunderstood the :packloadall command, thinking that it did the equivalent of :packadd ALL (that command doesn't actually exist). Now that I've re-read the docs for :packloadall I wonder how I missed it. – nelstrom Apr 15 '17 at 21:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.