require("CopilotChat").setup({ providers = { my_mac = { get_url = function(otps) return "http://192.168.8.10:11434/v1" end, get_models = function() return { { id = "qwen2.5:14b" } } end, prepare_input = require("CopilotChat.config.providers").copilot.prepare_input, prepare_output = require("CopilotChat.config.providers").copilot.prepare_output, }, }, }) vim.g.copilot_no_tab_map = true vim.g.copilot_enabled = false vim.keymap.set("n", "cc", ":CopilotChat", { desc = "Open Copilot Chat" }) vim.keymap.set("n", "cr", ":CopilotChatRestart", { desc = "Restart Copilot Chat" }) vim.keymap.set("n", "cs", ":CopilotChatStop", { desc = "Stop Copilot Chat" }) vim.keymap.set("n", "ca", ":CopilotChatAccept", { desc = "Accept Copilot Chat Suggestion" }) vim.keymap.set("n", "cn", ":CopilotChatNext", { desc = "Next Copilot Chat Suggestion" }) vim.keymap.set("n", "cp", ":CopilotChatPrev", { desc = "Previous Copilot Chat Suggestion" }) vim.keymap.set("n", "cd", ":CopilotChatClose", { desc = "Dismiss Copilot Chat" }) local function toggle_copilot() local copilot_enabled = vim.g.copilot_enabled if copilot_enabled == 1 then vim.cmd("Copilot disable") print("Copilot disabled") else vim.cmd("Copilot enable") print("Copilot enabled") end end vim.keymap.set("n", "ct", toggle_copilot, { desc = "Toggle Copilot" })