-
Hi, I migrated from Packer and would like to load the fugitive plugin for all commands that start with G. In packer I only had to define a cmd with a pattern "G*". As I understand lazy.nvim offers to define lazy load conditions with functions but I can't find anywhere some example, documentation or anything. The specs mention
This is always returning |
Beta Was this translation helpful? Give feedback.
Answered by
blob42
Oct 20, 2024
Replies: 1 comment
-
This is my solution so far if anyone encounters the same issue. 'tpope/vim-fugitive',
init = function(_)
vim.api.nvim_create_autocmd('CmdlineLeave', {
group = vim.api.nvim_create_augroup('lazy_manual', { clear = true }),
pattern = '*',
callback = function()
local cmdline = vim.fn.getcmdline()
if cmdline:match '^G.*' then
require('lazy').load { plugins = { 'vim-fugitive' } }
end
end,
})
end,
lazy = true,
...
}, |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
blob42
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is my solution so far if anyone encounters the same issue.