k-takata / minpac

A minimal package manager for Vim 8+ (and Neovim)
841 stars 30 forks source link

Proper way to install plugins with a function from that plugin #95

Closed Th3Whit3Wolf closed 4 years ago

Th3Whit3Wolf commented 4 years ago

I have read through the issues and from my understanding the vim's package manager works is newly installed plugins aren't added into runtime until the next time vim is opened.

Is there any way to reload the runtime or anyway to use that plugins function without exiting vim?

NilsIrl commented 4 years ago

This is a problem in firenvim: https://github.com/glacambre/firenvim/blob/fa79a10fdb302bce341c6cc6a21ddc1263faebdc/README.md#pre-built

NilsIrl commented 4 years ago

We found a solution for firenvim: https://github.com/glacambre/firenvim/blob/f47791f01a215b6722d426d0cf697b96e383d5d9/README.md#pre-built

I don't think there is any acceptable fix here and this issue can be closed. The best solution IMO is this "workaround".

ahmedelgabri commented 4 years ago

@Th3Whit3Wolf this might be useful for you https://github.com/k-takata/minpac/issues/74#issuecomment-462643066

Th3Whit3Wolf commented 4 years ago

Workaround as discussed by @NilsIrl here

call minpac#add('pluginauthor/plugin', { 'type': 'opt', 'do': 'packadd plugin | call plugin#function()'})

Obvious short comings of this approach is that this means you must load the plugin on its own or setup an autoload function.

If you need the plugin on (neo)vim startup then I recommend add this to your vimrc

autocmd VimEnter * packadd plugin
NilsIrl commented 4 years ago

If you need the plugin on (neo)vim startup then I recommend add this to your vimrc

autocmd VimEnter * packadd plugin

I would just put the following in your .vimrc:

packadd plugin
Th3Whit3Wolf commented 4 years ago

If you need the plugin on (neo)vim startup then I recommend add this to your vimrc

autocmd VimEnter * packadd plugin

I would just put the following in your .vimrc:

packadd plugin

Yeah that's definitely the more easy obvious solution, I'm not sure why that wasn't the first thing that popped into my head