Nvim: setup cmp for copilot

This commit is contained in:
Marko Korhonen 2023-10-04 11:01:08 +03:00
parent 2a6e453156
commit b36e9f5393
Signed by: FunctionalHacker
GPG key ID: A7F78BCB859CD890
2 changed files with 14 additions and 1 deletions

View file

@ -8,6 +8,9 @@ return function()
-- Setup git completion source
require("cmp_git").setup()
--
-- Setup copilot source
require("copilot_cmp").setup()
-- Set completeopt to have a better completion experience
vim.o.completeopt = "menuone,noselect"
@ -49,6 +52,7 @@ return function()
end,
},
sources = {
{ name = "copilot" },
{ name = "nvim_lsp" },
{ name = "nvim_lua" },
{ name = "luasnip" },

View file

@ -130,6 +130,7 @@ local plugins = {
"hrsh7th/cmp-cmdline", -- cmdline source
"saadparwaiz1/cmp_luasnip", -- Snippets source
"f3fora/cmp-spell", -- Spell check source
"zbirenbaum/copilot-cmp", -- Copilot source
},
config = require("plugins.cmp"),
},
@ -221,7 +222,15 @@ local plugins = {
},
-- GitHub Copilot
{ "zbirenbaum/copilot.lua", config = true },
{
"zbirenbaum/copilot.lua",
config = function()
require("copilot").setup({
suggestion = { enabled = false },
panel = { enabled = false },
})
end,
},
}
local lazy_opts = {}