Auto commit: 2024-11-08 19:05:02

This commit is contained in:
Daniel Fichtinger 2024-11-08 19:05:02 -05:00
parent cc0e5ef8e9
commit 287902b473
3 changed files with 19 additions and 16 deletions

View file

@ -2,25 +2,24 @@ return {
{
"zbirenbaum/copilot-cmp",
opts = function()
local copilot_toggle = require("lazyvim.util.toggle").wrap({
name = "Copilot Completion",
get = function()
return not require("copilot.client").is_disabled()
end,
set = function(state)
if state then
require("copilot.command").enable()
else
require("copilot.command").disable()
end
end,
})
-- local copilot_toggle = require("lazyvim.util.toggle").wrap({
-- name = "Copilot Completion",
-- get = function()
-- return not require("copilot.client").is_disabled()
-- end,
-- set = function(state)
-- if state then
-- require("copilot.command").enable()
-- else
-- require("copilot.command").disable()
-- end
-- end,
-- })
-- disable by default
require("copilot.command").disable()
local cpt = Snacks.toggle.new({
local cptoggle = Snacks.toggle.new({
name = "Copilot",
map = vim.keymap.set,
-- map = vim.keymap.set,
which_key = true,
get = function()
return not require("copilot.client").is_disabled()
@ -34,6 +33,7 @@ return {
end
end,
})
Snacks.toggle.map(cptoggle, "<leader>at", { desc = "Toggle Copilot" })
-- LazyVim.toggle.map("<leader>at", copilot_toggle)
end,
},