neovim-dots/lua/plugins/copilot.lua

35 lines
821 B
Lua
Raw Normal View History

return {
{
"zbirenbaum/copilot.lua",
2024-04-20 16:00:09 -07:00
cmd = "Copilot",
build = ":Copilot auth",
opts = {
suggestion = { enabled = false },
panel = { enabled = false },
filetypes = {
markdown = false,
help = true,
},
},
},
{
"zbirenbaum/copilot-cmp",
dependencies = "copilot.lua",
opts = {
event = { "InsertEnter", "LspAttach" },
fix_pairs = true,
},
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
LazyVim.lsp.on_attach(function(client)
if client.name == "copilot" then
copilot_cmp._on_insert_enter({})
end
end)
end,
},
}