Lazy loading vimspector #531
-
New to packer.nvim, so this is most likely a newbie question. I cloned NvChad and started configuring it (the call to packer.setup is in pluginList.lua). I added vimspector as such: use {
"puremourning/vimspector",
cmd = {
"call vimspector#Launch()"
}
} I tried to use PackerStatus to see if vimspector is loaded after installing it and saw that it was loaded, even though I expected it to be loaded only once the Launch function is invoked. I have vimspector#Launch bound to start a new debugging session, so I would like it to be the trigger to load vimspector. P.S. there is also vimspector#Reset to unload vimspector. Just out of curiosity, does packer support unloading a package and then reload it again using some trigger (such as the cmd trigger)? I guess this would cause wasting too much time on loading and unloading but it could be a neat way to use a lot of plugins on weaker machines where the concern is not only startup time but also RAM and such. Thanks for any help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Welcome! I have a few comments:
I hope this helps! |
Beta Was this translation helpful? Give feedback.
Welcome! I have a few comments:
PackerSync
after saving your changes? Ifvimspector
was originally astart
plugin, you need this (orPackerCompile
+PackerUpdate
independently) to build the lazy-loader and movevimspector
to theopt
plugin dir.fn
key instead ofcmd
, as infn = 'vimspector#Launch'
. This more closely matches your desired load conditions, and I do not believe that the command you've specified would work anyway (cmd
is for command names rather than commands with specific arguments).