Closed ahmedelgabri closed 4 years ago
Yeah i noticed the same thing. Had plans to optimize it, just didn't grab enough time.
Solution to this is to not call init every time. Is there any specific reason you do that? Having it loaded only when needed should do the trick, and it won't slow anything down.
Yeah i noticed the same thing. Had plans to optimize it, just didn't grab enough time.
Great, thanks. I'll wait for this then.
Solution to this is to not call init every time. Is there any specific reason you do that? Having it loaded only when needed should do the trick, and it won't slow anything down.
plugins#init()
is an autoloaded function so if I don't call it, then commands
won't work properly because no plugin will be loaded including vim-packager
or minpac
. Or am I missing something here?
Plugins are automatically loaded, at least those that are not in the opt
folder. That's the main feature of minpac/vim-packager. Vim/NeoVim does the loading, no need to do it manually like in vim-plug.
Check the example vimrc content here in readme https://github.com/kristijanhusak/vim-packager#vimrc-content
With those commands in the example, function loads up vim-packager and all the plugins for installation/update/clean.
This means that only when running install/update/clean things will take a second or two, but that's not really that bad.
Plugins are automatically loaded, at least those that are not in the
opt
folder. That's the main feature of minpac/vim-packager. Vim/NeoVim does the loading, no need to do it manually like in vim-plug.
You are right, I dunno why I did this in the first place… will clean this up & see.
Fixing plugins#init()
& the commands fixed the issue.
FYI, PackagerClean
or PackagerStatus
are slower than minpac
too. Not a big deal at all, but worth mentioning.
Thank you
@ahmedelgabri I optimized it a bit. Do an update and check. Should be faster now.
I still don't suggest calling plugins#init()
on vim startup, because there's no really a need for it.
@ahmedelgabri I optimized it a bit. Do an update and check. Should be faster now.
Slightly better yeah, thanks!
I still don't suggest calling
plugins#init()
on vim startup, because there's no really a need for it.
The idea behind plugins#init()
was to auto install packages when I initially setup a new machine (I know that I can do nvim +PackInstall
, but I'm lazy & I know that I will forget doing this on a new machine), the implementation though was bad. So I will need to revisit that. Right now I changed the logic to exit early so it's just a simple check.
This might not be a plugin issue, maybe it's more how my config is set up. But I hope I can find some pointers on how to fix this.
This is my current setup with
minpac
&plugins#init()
is called ininit.vim
This is the new setup with
vim-packager
as you can see nothing much changed, it's a drop-in replacement for minpac.I'm facing an issue with this line which runs every time I open neovim. With
minpac
there is nearly no overhead & things are instantaneous but withvim-packager
this takes a couple of seconds.minpac![minpac](https://user-images.githubusercontent.com/63876/69666221-33475480-108c-11ea-9ab8-e90bdc369110.gif)
vim-packager![vim-packager](https://user-images.githubusercontent.com/63876/69666572-be284f00-108c-11ea-9863-f18ab4a6906d.gif)