2024-11-03 00:27:08 +02:00
|
|
|
return {
|
|
|
|
|
{
|
|
|
|
|
'zbirenbaum/copilot.lua',
|
|
|
|
|
cmd = 'Copilot',
|
2024-11-15 22:27:57 +02:00
|
|
|
event = 'InsertEnter',
|
2024-11-03 00:27:08 +02:00
|
|
|
build = ':Copilot auth',
|
|
|
|
|
opts = {
|
|
|
|
|
filetypes = {
|
|
|
|
|
markdown = true,
|
|
|
|
|
help = true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
'zbirenbaum/copilot-cmp',
|
|
|
|
|
dependencies = 'copilot.lua',
|
|
|
|
|
opts = {},
|
|
|
|
|
config = function(_, opts)
|
|
|
|
|
local copilot_cmp = require 'copilot_cmp'
|
|
|
|
|
copilot_cmp.setup(opts)
|
2025-03-09 14:01:24 +02:00
|
|
|
vim.api.nvim_create_autocmd('LspAttach', {
|
|
|
|
|
callback = function(args)
|
|
|
|
|
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
|
|
|
|
if client and client.name == 'copilot' then
|
|
|
|
|
copilot_cmp._on_insert_enter {}
|
|
|
|
|
end
|
|
|
|
|
end,
|
|
|
|
|
})
|
2024-11-03 00:27:08 +02:00
|
|
|
end,
|
|
|
|
|
},
|
|
|
|
|
}
|