fix: nvim_cmp config for copilot (wip)

This commit is contained in:
Rob Watson 2023-09-18 08:01:47 +02:00
parent c468aecea9
commit d5d5ca6fa7
1 changed files with 4 additions and 4 deletions

8
nvimrc
View File

@ -367,23 +367,23 @@ lua <<EOF
cmp.setup({
completion = {
completeopt = 'menu,menuone,noinsert',
keyword_length = 3,
},
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
end,
},
mapping = {
mapping = cmp.mapping.preset.insert({
['<C-u>'] = cmp.mapping.scroll_docs(-4),
['<C-d>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['C-y'] = cmp.mapping.confirm({ select = true, behaviour = cmp.ConfirmBehavior.Replace }),
['<CR>'] = cmp.mapping.confirm({ select = true, behaviour = cmp.ConfirmBehavior.Replace }),
},
}),
sources = cmp.config.sources({
{ name = 'copilot', keyword_length = 0 },
{ name = 'nvim_lsp' },
{ name = 'nvim_lsp', keyword_length = 3 },
{
name = 'buffer',
option = {