-
I have something like this in my plugins file: use({
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
config = function()
require("configs.nvim-cmp")
end,
},
{ "hrsh7th/cmp-buffer", after = "nvim-cmp" },
}) Since I lazy-loaded Now, the problem with above code is that So, is there a way to load a plugin ( |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
There is a
and
I do this for lazy loading themes. |
Beta Was this translation helpful? Give feedback.
-
Try this: use({
"hrsh7th/nvim-cmp",
requires = {
{ "hrsh7th/cmp-buffer", after = "nvim-cmp" },
{
"L3MON4D3/LuaSnip",
requires = { "rafamadriz/friendly-snippets" },
config = function() require("settings.luasnip") end,
event = { "BufNewFile", "BufRead", "InsertEnter" },
},
{ "saadparwaiz1/cmp_luasnip", after = "nvim-cmp" },
},
after = { "LuaSnip", "nvim-treesitter" } ,
wants = { "LuaSnip" },
config = function() require("settings.cmp") end,
event = { "BufNewFile", "BufRead", "InsertEnter" },
})
I have added more dependencies here as examples. Anything in the |
Beta Was this translation helpful? Give feedback.
-
Apologies for getting back to this a bit late. Unfortunately the solution by @mblarsen does not seem to work with |
Beta Was this translation helpful? Give feedback.
Apologies for getting back to this a bit late. Unfortunately the solution by @mblarsen does not seem to work with
nvim-cmp
and to be honest I do not like the verbosity of the solution by @arsham (though I haven't checked if it works or not). Also I'm starting to think this is because of howcmp
is structured as a similar issue was posted there a while ago (see hrsh7th/nvim-cmp#65 for more info).