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

View file

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