fix: nvim_cmp config for copilot (wip)
This commit is contained in:
parent
c468aecea9
commit
d5d5ca6fa7
8
nvimrc
8
nvimrc
|
@ -367,23 +367,23 @@ lua <<EOF
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
completion = {
|
completion = {
|
||||||
completeopt = 'menu,menuone,noinsert',
|
completeopt = 'menu,menuone,noinsert',
|
||||||
keyword_length = 3,
|
|
||||||
},
|
},
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
vim.fn["vsnip#anonymous"](args.body)
|
vim.fn["vsnip#anonymous"](args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
mapping = {
|
mapping = cmp.mapping.preset.insert({
|
||||||
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
||||||
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
['<C-Space>'] = cmp.mapping.complete(),
|
||||||
['<C-e>'] = cmp.mapping.close(),
|
['<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 }),
|
['<CR>'] = cmp.mapping.confirm({ select = true, behaviour = cmp.ConfirmBehavior.Replace }),
|
||||||
},
|
}),
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = 'copilot', keyword_length = 0 },
|
{ name = 'copilot', keyword_length = 0 },
|
||||||
{ name = 'nvim_lsp' },
|
{ name = 'nvim_lsp', keyword_length = 3 },
|
||||||
{
|
{
|
||||||
name = 'buffer',
|
name = 'buffer',
|
||||||
option = {
|
option = {
|
||||||
|
|
Loading…
Reference in New Issue