-- Autocompletion shenanigans local cmp = require'cmp' cmp.setup({ snippet = { expand = function(args) vim.fn["vsnip#anonymous"](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_lsp' }, { name = 'vsnip' }, { name = 'buffer' }, }) }) -- filetype specific setup -- gitconfig cmp.setup.filetype('gitcommit', { sources = cmp.config.sources({ { name = 'git' }, { name = 'buffer' }, }) }) -- / andd ? completion cmp.setup.cmdline({'/', '?'}, { mapping = cmp.mapping.preset.cmdline(), sources = { { name = 'buffer' } }, }) -- : completion cmp.setup.cmdline(':', { mapping = cmp.mapping.preset.cmdline(), sources = { { name = 'path' }, { name = 'cmdline' }, }, matching = { disallow_symbol_nonprefix_matching = false }, })