return { { "hrsh7th/cmp-nvim-lsp", }, { "hrsh7th/nvim-cmp", dependencies = { "neovim/nvim-lspconfig", "hrsh7th/cmp-buffer", "hrsh7th/cmp-path", "hrsh7th/cmp-cmdline", "saadparwaiz1/cmp_luasnip", }, opts = function() local cmp = require("cmp") require("luasnip.loaders.from_vscode").lazy_load() return { snippet = { expand = function(args) require("luasnip").lsp_expand(args.body) end, }, window = { completion = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(), }, sources = { { name = "nvim_lsp" }, { name = "luasnip" }, { name = "buffer" }, }, 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 }), }), } end, --[[ keys = { { "", function() require('cmp').mapping.scroll_docs(-4) end }, { "", function() require('cmp').mapping.scroll_docs(4) end }, { "", function() require('cmp').mapping.complete() end }, { "", function() require('cmp').mapping.abort() end }, { "", function() require('cmp').mapping.confirm({ select = true }) end }, }, ]] -- }, }