lazy load nvim-cmp if snippets are disabled

This commit is contained in:
siduck 2022-01-29 19:59:40 +05:30
parent 2a02054a39
commit 0349de6d10
1 changed files with 4 additions and 1 deletions

View File

@ -131,10 +131,13 @@ return packer.startup(function()
disable = not (plugin_settings.status.cmp and plugin_settings.status.snippets),
event = "InsertEnter",
}
-- cmp by default loads after friendly snippets
-- if snippets are disabled -> cmp loads on insertEnter!
use {
"hrsh7th/nvim-cmp",
disable = not plugin_settings.status.cmp,
event = plugin_settings.status.snippets and 'InsertEnter',
after = plugin_settings.status.snippets and "friendly-snippets",
config = override_req("nvim_cmp", "plugins.configs.cmp", "setup"),
}