diff --git a/lua/plugins/configs/cmp.lua b/lua/plugins/configs/cmp.lua index e8518e6..064f8c9 100644 --- a/lua/plugins/configs/cmp.lua +++ b/lua/plugins/configs/cmp.lua @@ -1,10 +1,9 @@ vim.opt.completeopt = "menuone,noselect" local lspkind = require "plugins.configs.lspkind_icons" -local luasnip = require "luasnip" +local cmp = require "cmp" -- nvim-cmp setup -local cmp = require "cmp" cmp.setup { snippet = { expand = function(args) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index e80605e..90e394e 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -176,25 +176,25 @@ return packer.startup(function() -- load luasnips + cmp related in insert mode only use { - "L3MON4D3/LuaSnip", + "hrsh7th/nvim-cmp", event = "InsertEnter", + config = function() + require "plugins.configs.cmp" + end, + } + + use { + "L3MON4D3/LuaSnip", wants = "friendly-snippets", + after = "nvim-cmp", config = function() require "plugins.configs.luasnip" end, } - use { - "hrsh7th/nvim-cmp", - config = function() - require "plugins.configs.cmp" - end, - after = "LuaSnip", - } - use { "saadparwaiz1/cmp_luasnip", - after = "nvim-cmp", + after = "LuaSnip", } use {