nvim/lua/config/keymaps.lua

27 lines
721 B
Lua
Raw Normal View History

2024-11-09 03:13:18 +00:00
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here
--
local Snacks = require("snacks")
local copilot_exists = pcall(require, "copilot")
if copilot_exists then
Snacks.toggle({
name = "Copilot Completion",
color = {
enabled = "azure",
disabled = "orange",
},
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,
}):map("<leader>at")
end