Skip to content

Commit

Permalink
feat(copilot): change default model, context selection, predefined ac…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
WilliamHsieh committed Dec 26, 2024
1 parent aa67dc6 commit 3e8f17f
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions config/nvim/lua/plugins/copilotchat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@
local M = {
"CopilotC-Nvim/CopilotChat.nvim",
cmd = "CopilotChat",
build = function()
vim.notify("Please update the remote plugins by running ':UpdateRemotePlugins', then restart Neovim.")
end,
}

---@type CopilotChat.config
M.opts = {
insert_at_end = true,
model = "claude-3.5-sonnet",
auto_follow_cursor = false,
highlight_headers = false,
separator = "",
error_header = "> [!ERROR] Error",
prompts = {
Explain = {
prompt =
"/COPILOT_EXPLAIN Write an explanation for the active selection as paragraphs of text. If the context is code, include the relevent code snippet and corresponding line number at the beginning of each praragraph, separated by a line break.",
prompt = "/COPILOT_EXPLAIN Write an explanation for the active selection as paragraphs of text. If the context is code, include the relevent code snippet and corresponding line number at the beginning of each praragraph, separated by a line break.",
},
},
mappings = {
complete = {
-- otherwise it's conflicting with cmp.nvim
insert = "<S-Tab>",
},
},
}
Expand All @@ -39,6 +41,15 @@ M.keys = {
"<cmd>CopilotChatFixDiagnostic<cr>",
desc = "CopilotChat - Fix diagnostic",
},
{
"<leader>ca",
function()
local actions = require("CopilotChat.actions")
require("CopilotChat.integrations.fzflua").pick(actions.prompt_actions())
end,
mode = { "n", "v" },
desc = "CopilotChat - Prompt actions",
},
{
"<leader>co",
function()
Expand Down

0 comments on commit 3e8f17f

Please sign in to comment.