feat(nvim): update plugins and config

This commit is contained in:
2026-04-24 20:42:17 -04:00
parent 45dceba337
commit 2aff2eb423
14 changed files with 251 additions and 215 deletions
+50 -50
View File
@@ -1,14 +1,14 @@
vim.keymap.set({'n', 'v'}, '<leader>rct', '<cmd>CodeCompanionChat Toggle<cr>', { noremap = true, silent = true, desc = "CC Toggle" })
vim.keymap.set({ 'n', 'v' }, '<leader>rca', '<cmd>CodeCompanionActions<cr>', { noremap = true, silent = true, desc = "CC Action" })
vim.keymap.set({ 'n' }, '<leader>rce', '<cmd>CodeCompanion Explain<cr>', { desc = "CC Explain" })
vim.keymap.set({ 'n' }, '<leader>rcf', '<cmd>CodeCompanion Fix code<cr>', { desc = "CC fix" })
vim.keymap.set({ 'v' }, '<leader>rcc', '<cmd>CodeCompanionChat Add<cr>', { noremap = true, silent = true, desc = "CC Add" })
vim.keymap.set({ 'v' }, '<leader>rcr', '<cmd>CodeCompanion Code Review<cr>', { desc = 'Code Review' })
vim.keymap.set({ 'v' }, '<leader>rco', '<cmd>CodeCompanion Optimize Performance<cr>', { desc = 'Optimize Code' })
vim.keymap.set({ 'v' }, '<leader>rce', '<cmd>CodeCompanion Explain Code<cr>', { desc = 'Explain Code' })
vim.keymap.set({ 'v' }, '<leader>rcg', '<cmd>CodeCompanion Generate Tests<cr>', { desc = 'Generate Tests' })
vim.keymap.set({ 'v' }, '<leader>rcd', '<cmd>CodeCompanion Debug Analysis<cr>', { desc = 'Debug Analysis' })
vim.keymap.set({'n', 'v'}, '<leader>mct', '<cmd>CodeCompanionChat Toggle<cr>', { noremap = true, silent = true, desc = "CC Toggle" })
vim.keymap.set({'n', 'v'}, '<leader>mca', '<cmd>CodeCompanionActions<cr>', { noremap = true, silent = true, desc = "CC Action" })
vim.keymap.set({'n'}, '<leader>mce', '<cmd>CodeCompanion Explain<cr>', { desc = "CC Explain" })
vim.keymap.set({'n'}, '<leader>mcf', '<cmd>CodeCompanion Fix code<cr>', { desc = "CC fix" })
vim.keymap.set({'v'}, '<leader>mcc', '<cmd>CodeCompanionChat Add<cr>', { noremap = true, silent = true, desc = "CC Add" })
vim.keymap.set({'v'}, '<leader>mcr', '<cmd>CodeCompanion Code Review<cr>', { desc = 'Code Review' })
vim.keymap.set({'v'}, '<leader>mco', '<cmd>CodeCompanion Optimize Performance<cr>', { desc = 'Optimize Code' })
vim.keymap.set({'v'}, '<leader>mce', '<cmd>CodeCompanion Explain Code<cr>', { desc = 'Explain Code' })
vim.keymap.set({'v'}, '<leader>mcg', '<cmd>CodeCompanion Generate Tests<cr>', { desc = 'Generate Tests' })
vim.keymap.set({'v'}, '<leader>mcd', '<cmd>CodeCompanion Debug Analysis<cr>', { desc = 'Debug Analysis' })
-- TODO: run this command
-- build = "uv tool upgrade vectorcode", -- This helps keeping the CLI up-to-date
@@ -196,36 +196,36 @@ codecompanion.setup({
end,
codex = function()
return require("codecompanion.adapters").extend("codex", {
commands = {
default = { "codex-acp" },
},
schema = {
model = {
default = "github-copilot/gpt-5.2-codex",
},
},
defaults = {
timeout = 20000,
auth_method = "chatgpt", -- "openai-api-key"|"codex-api-key"|"chatgpt"
},
})
end,
opencode = function()
return require("codecompanion.adapters").extend("codex", {
commands = {
default = { "opencode", "acp" },
},
schema = {
model = {
default = "github-copilot/gpt-5.2-codex",
},
},
-- commands = {
-- default = { "codex-acp" },
-- },
-- schema = {
-- model = {
-- default = "github-copilot/gpt-5.2-codex",
-- },
-- },
defaults = {
timeout = 20000,
auth_method = "chatgpt", -- "openai-api-key"|"codex-api-key"|"chatgpt"
},
})
end,
-- opencode = function()
-- return require("codecompanion.adapters").extend("codex", {
-- commands = {
-- default = { "opencode", "acp" },
-- },
-- schema = {
-- model = {
-- default = "github-copilot/gpt-5.2-codex",
-- },
-- },
-- defaults = {
-- timeout = 20000,
-- auth_method = "chatgpt", -- "openai-api-key"|"codex-api-key"|"chatgpt"
-- },
-- })
-- end,
},
},
rules = {
@@ -265,10 +265,10 @@ codecompanion.setup({
save_chat_keymap = "ghs",
picker = "snacks",
dir_to_save = vim.env.HOME .. "/Documents/ai-history",
title_generation_opts = {
adapter = "copilot",
model = "gpt-5-mini",
},
-- title_generation_opts = {
-- adapter = "copilot",
-- model = "gpt-5-mini",
-- },
summary = {
create_summary_keymap = "ghc",
browse_summaries_keymap = "ghb",
@@ -298,20 +298,25 @@ codecompanion.setup({
},
tools = {
opts = {
auto_submit_errors = true, -- Send any errors to the LLM automatically?
auto_submit_success = true, -- Send any successful output to the LLM automatically?
auto_submit_errors = false, -- Send any errors to the LLM automatically?
auto_submit_success = false, -- Send any successful output to the LLM automatically?
system_prompt = {
enabled = true,
replace_main_system_prompt = false,
},
default_tools = {
"ask_questions",
"file_search",
"read_file",
"cmd_runner",
"fetch",
"grep_search",
"memory",
-- "ddgr_search",
},
},
["fetch_enhanced"] = {
description = "Fetch a data from the web",
callback = function(url, options)
options = options or {}
local max_length = options.max_length or 200000 -- 200KB default
@@ -413,6 +418,7 @@ codecompanion.setup({
description = "Planning my project and codes with enhanced web access",
prompt = "Using all the ${tools} at your disposal including enhanced web fetching. Analyze the codes and use it to help me with my query. You have access to unlimited web content fetching.",
tools = {
"ask_questions",
"fetch", -- Backup unlimited fetch
"file_search",
"grep_search",
@@ -436,6 +442,7 @@ codecompanion.setup({
description = "Deep research with unlimited web access",
prompt = "You are a research assistant with unlimited web access. Using the ${tools} fetch and analyze large documents, research papers, and comprehensive web content.",
tools = {
"ask_questions",
"fetch",
"fetch_enhanced",
"file_search",
@@ -450,14 +457,7 @@ codecompanion.setup({
description = "Full-stack development with all necessary tools",
prompt = "You are an expert full-stack developer. Use ${tools} to understand, modify, and test code. Always gather context before making changes.",
tools = {
"file_search",
"grep_search",
"fetch",
"list_code_usages",
"read_file",
"insert_edit_into_file",
"cmd_runner",
"next_edit_suggestion",
"agents",
},
opts = {
collapse_tools = true,
@@ -619,7 +619,7 @@ codecompanion.setup({
role = "user",
content = function(context)
local code = require("codecompanion.helpers.actions").get_code(context.start_line, context.end_line)
return fmt(
return string.format(
[[Help me debug this code from buffer %d and identify potential issues:
```%s
@@ -635,7 +635,7 @@ codecompanion.setup({
}
},
},
cc_keyword = { "bug", "debug", "error", "exception", "crash", "stacktrace", "broken", "issue" },
cc_keywords = { "bug", "debug", "error", "exception", "crash", "stacktrace", "broken", "issue" },
},
["Architecture Review"] = {
interaction = "chat",