local cmp = require'cmp' cmp.setup({ snippet = { expand = function(args) require('luasnip').lsp_expand(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 = true }), }), sources = cmp.config.sources({ { name = 'nvim_lua' }, { name = 'nvim_lsp'}, { name = 'path' }, { name = 'luasnip' }, { name = 'nvim_lsp_signature_help' }, }), preselect = cmp.PreselectMode.None, }) cmp.setup.filetype('gitcommit', { sources = cmp.config.sources({ { name = 'cmp_git' }, }) }) cmp.setup.cmdline({ '/', '?' }, { mapping = cmp.mapping.preset.cmdline(), }) cmp.setup.cmdline(':', { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ { name = 'path' }, { name = 'cmdline', keyword_length = 4 } }), })