From 239dad6524ea73ffc01d0be066f5bda54fc2fc0e Mon Sep 17 00:00:00 2001 From: Martin Larsson Date: Sun, 22 Sep 2024 15:20:01 +0200 Subject: [PATCH] Add keybinds for code companion --- home/.config/nvim/lua/plugs/codecompanion.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/home/.config/nvim/lua/plugs/codecompanion.lua b/home/.config/nvim/lua/plugs/codecompanion.lua index f8c0077..70acbe7 100644 --- a/home/.config/nvim/lua/plugs/codecompanion.lua +++ b/home/.config/nvim/lua/plugs/codecompanion.lua @@ -32,5 +32,22 @@ return { log_level = "DEBUG", }, }) + + require("utils").add_keymaps({ + n = { + ["ci"] = { cmd = "CodeCompanion" }, + ["cc"] = { cmd = "CodeCompanionToggle" }, + ["cm"] = { cmd = "CodeCompanion /commit" }, + }, + v = { + ["ci"] = { cmd = "CodeCompanion" }, + ["ga"] = { cmd = "CodeCompanionAdd" }, + ["ce"] = { cmd = "CodeCompanion /explain" }, + ["cf"] = { cmd = "CodeCompanion /fix" }, + ["ct"] = { cmd = "CodeCompanion /tests" }, + } + }) + + vim.cmd([[cab cc CodeCompanion]]) end }