Closed shmerl closed 5 months ago
vim-plug currently can't source lua plugins when lazy-loaded. #1157
Plug 'mfussenegger/nvim-dap', { 'on': 'LoadDebug' }
That's not how you do it. When you write { 'on': 'LoadDebug' }
, vim-plug defines a proxy command in that name which loads the plugin and executes the command from the loaded plugin.
Instead, you can pass an empty array as on
so that the plugins are not loaded, and call plug#load
from your command to load those plugins later.
Plug 'mfussenegger/nvim-dap', { 'on': [] }
Plug 'rcarriga/nvim-dap-ui', { 'on': [] }
command! LoadDebug call plug#load('nvim-dap', 'nvim-dap-ui')
I'm trying to load a few plugins based on a custom command. So I defined something like this:
And then in the vim-plug section, I was doing this:
But it doesn't work. It does work with some other commands defined by plugins themselves. Is there a way to make it work or may be I'm missing something?