3

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.

nelstrom
  • 289
  • 2
  • 8

1 Answers1

6

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.

Martin Tournoij
  • 62,054
  • 25
  • 192
  • 271
  • 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