neovim/lua/_copilot.lua
2025-12-30 01:31:05 -06:00

47 lines
1.2 KiB
Lua

plugin({
lazy = false,
"CopilotC-Nvim/CopilotChat.nvim",
dependencies = {
{ "zbirenbaum/copilot.lua" }, -- or zbirenbaum/copilot.lua
{ "nvim-lua/plenary.nvim", branch = "master" }, -- for curl, log and async functions
},
build = "make tiktoken", -- Only on MacOS or Linux
opts = {
-- See Configuration section for options
},
-- See Commands section for default commands if you want to lazy load on them
})
plugin({
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
config = function()
require("copilot").setup({
suggestion = { enabled = true },
panel = { enabled = false },
})
end,
})
plugin({
"giuxtaposition/blink-cmp-copilot",
dependencies = {
{ "zbirenbaum/copilot.lua" },
},
})
map("n", "<leader>ac", function()
require("CopilotChat").open()
end, { desc = "Copilot chat" })
map("n", "<leader>ap", function()
require("copilot.panel").open()
end, { desc = "Copilot chat" })
map("v", "<leader>ad", function()
require("CopilotChat").ask("Create documentation for this code")
end, { desc = "Copilot chat" })
map("v", "<leader>at", function()
require("CopilotChat").ask("#buffer:active Write tests for this code")
end, { desc = "Copilot chat" })