return { 'hrsh7th/nvim-cmp', dependencies = { 'dcampos/cmp-snippy', --'mstanciu552/cmp-matlab', 'petertriho/cmp-git', 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-cmdline', 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-path', 'hrsh7th/cmp-calc', }, event = "InsertEnter", config = function() local cmp = require'cmp' cmp.setup({ -- snippet = { -- expand = function(args) -- require('snippy').expand_snippet(args.body) -- end, -- }, window = { completion = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(), }, 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 = false }), }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'path' }, { name = 'snippy' }, { name = 'calc' }, -- { name = 'cmp_matlab' }, { name = 'cmp_git' }, }, { { name = 'buffer', keyword_length = 5, max_item_count = 10, priority = -5 }, }), sorting = { comparators = { cmp.config.compare.offset, cmp.config.compare.exact, cmp.config.compare.recently_used, require("clangd_extensions.cmp_scores"), cmp.config.compare.kind, cmp.config.compare.sort_text, cmp.config.compare.length, cmp.config.compare.order, }, }, }) cmp.setup.cmdline({'/', '?'}, { mapping = cmp.mapping.preset.cmdline(), sources = { { name = 'buffer' } } }) cmp.setup.cmdline(':', { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ { name = 'path' } }, { { name = 'cmdline' } }) }) cmp.setup.filetype('gitcommit', { sources = cmp.config.sources({ {name = 'cmp_git' }, }, { {name = 'buffer' } }) }) require("cmp_git").setup() end }