return { "hrsh7th/nvim-cmp", event = "InsertEnter", dependencies = { { "hrsh7th/cmp-nvim-lsp" }, { "hrsh7th/cmp-buffer" }, { "hrsh7th/cmp-path" }, { "L3MON4D3/LuaSnip", build = "make install_jsregexp" }, { "saadparwaiz1/cmp_luasnip" }, }, config = function() local cmp = require("cmp") local luasnip = require("luasnip") cmp.setup({ completion = { completeopt = "menu,menuone,noselect", }, snippet = { expand = function(args) luasnip.lsp_expand(args.body) end, }, mapping = cmp.mapping.preset.insert({ [""] = cmp.mapping.scroll_docs(-4), [""] = cmp.mapping.scroll_docs(4), [""] = cmp.mapping.complete(), [""] = cmp.mapping.abort(), [""] = cmp.mapping.confirm({ select = true }), -- accept item under cursor when pressing enter }), sources = cmp.config.sources({ { name = "nvim_lsp" }, { name = "luasnip" }, { name = "orgmode" }, { name = "buffer" }, { name = "path" }, }), }) end, }