add copilot
parent
dc577b564f
commit
21c565534d
@ -0,0 +1,23 @@
|
||||
return {
|
||||
'zbirenbaum/copilot-cmp',
|
||||
dependencies = 'copilot.lua',
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
local copilot_cmp = require 'copilot_cmp'
|
||||
copilot_cmp.setup(opts)
|
||||
-- attach cmp source whenever copilot attaches
|
||||
-- fixes lazy-loading issues with the copilot cmp source
|
||||
local on_attach = function(client, _)
|
||||
if client.name == 'copilot' then
|
||||
copilot_cmp._on_insert_enter {}
|
||||
end
|
||||
end
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
callback = function(args)
|
||||
local buffer = args.buf ---@type number
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
on_attach(client, buffer)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
return {
|
||||
'zbirenbaum/copilot.lua',
|
||||
cmd = 'Copilot',
|
||||
build = ':Copilot auth',
|
||||
opts = {
|
||||
suggestion = { enabled = false },
|
||||
panel = { enabled = false },
|
||||
filetypes = {
|
||||
markdown = true,
|
||||
help = true,
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Reference in New Issue