init
This commit is contained in:
parent
506767063c
commit
8d9b436e09
3 changed files with 104 additions and 0 deletions
35
lua/custom/plugins/copilot.lua
Normal file
35
lua/custom/plugins/copilot.lua
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
return {
|
||||
{
|
||||
-- Taken from https://github.com/fredrikaverpil/dotfiles/blob/main/nvim-lazyvim/lua/plugins/ai.lua
|
||||
"zbirenbaum/copilot.lua",
|
||||
cmd = "Copilot",
|
||||
build = ":Copilot auth",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("copilot").setup({
|
||||
panel = {
|
||||
enabled = true,
|
||||
auto_refresh = true,
|
||||
},
|
||||
suggestion = {
|
||||
enabled = true,
|
||||
auto_trigger = true,
|
||||
accept = false, -- disable built-in keymapping
|
||||
},
|
||||
})
|
||||
|
||||
-- hide copilot suggestions when cmp menu is open
|
||||
-- to prevent odd behavior/garbled up suggestions
|
||||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||
if cmp_status_ok then
|
||||
cmp.event:on("menu_opened", function()
|
||||
vim.b.copilot_suggestion_hidden = true
|
||||
end)
|
||||
|
||||
cmp.event:on("menu_closed", function()
|
||||
vim.b.copilot_suggestion_hidden = false
|
||||
end)
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue