mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 00:49:03 +02:00
42 lines
1 KiB
Lua
42 lines
1 KiB
Lua
|
return {
|
||
|
|
||
|
-- copilot
|
||
|
{
|
||
|
"zbirenbaum/copilot.lua",
|
||
|
cmd = "Copilot",
|
||
|
build = ":Copilot auth",
|
||
|
opts = {
|
||
|
suggestion = { enabled = false },
|
||
|
panel = { enabled = false },
|
||
|
},
|
||
|
},
|
||
|
|
||
|
-- copilot cmp source
|
||
|
{
|
||
|
"nvim-cmp",
|
||
|
dependencies = {
|
||
|
{
|
||
|
"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
|
||
|
require("lazyvim.util").on_attach(function(client)
|
||
|
if client.name == "copilot" then
|
||
|
copilot_cmp._on_insert_enter()
|
||
|
end
|
||
|
end)
|
||
|
end,
|
||
|
},
|
||
|
},
|
||
|
---@param opts cmp.ConfigSchema
|
||
|
opts = function(_, opts)
|
||
|
local cmp = require("cmp")
|
||
|
opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "copilot" } }))
|
||
|
end,
|
||
|
},
|
||
|
}
|