return { "hrsh7th/nvim-cmp", dependencies = { "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-buffer", "hrsh7th/cmp-path", "hrsh7th/cmp-cmdline", -- for vsnip users "hrsh7th/cmp-vsnip", "hrsh7th/vim-vsnip", }, opts = function () local cmp = require('cmp') return { mapping = cmp.mapping.preset.insert({ [''] = cmp.mapping.confirm({ -- behavior = cmp.ConfirmBehavior.Insert, select = true, }), [''] = cmp.mapping.abort(), -- [''] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 's' }), }), snippet = { -- REQUIRED - you must specify a snippet engine expand = function(args) vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users. -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. -- require'snippy'.expand_snippet(args.body) -- For `snippy` users. end, }, sources = cmp.config.sources({ { name = 'nvim_lsp' }, }, { {name = 'buffer'}, }), } end }