Closed benlieb closed 1 year ago
This is from the README
:
cmp.setup {
...
sources = {
-- Copilot Source
{ name = "copilot", group_index = 2 },
-- Other Sources
{ name = "nvim_lsp", group_index = 2 },
{ name = "path", group_index = 2 },
{ name = "luasnip", group_index = 2 },
},
...
}
Go to where nvim-cmp
is configured, look for a keyword named sources
and add the copilot line to it.
I recommend you follow the README
Setup section to get the basic configuration up and running.
And welcome to the nvim community ;)
Thank you. I did finally figure it out.
The first issue was to realize that
cmp.setup {
probably meant
local cmp = require('nvim-cmp')
cmp.setup {
This might be obvious to others, but wasn't to me. Once I figured that out I found out how lsp-zero
configures nvim-cmp
lsp.setup_nvim_cmp({
sources = {
{ name = "copilot", group_index = 2 },
{ name = 'path'},
{ name = 'nvim_lsp'},
{ name = 'buffer', keyword_length = 3},
{ name = 'luasnip', keyword_length = 2},
}
})
Thanks again!
No problem :)
The copilot suggestions don't appear in the LSP options or as ghost text.
I am using the lsp-zero setup (which I admittedly don't understand very well). I'm somewhat new to nvim.
It seems I may need to add copilot as a source to
cmp
but I'm not sure what variable that is, or what package it comes from.Here is my ~
packer.lua
Please help, I spent my whole morning on this!