chore(mappings): add options to reflect wiki changes (#349)

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
Aaron Pham
2024-08-29 01:09:26 -04:00
committed by GitHub
parent cb197fb606
commit 1e009822e4
3 changed files with 27 additions and 28 deletions

View File

@@ -28,13 +28,6 @@ H.commands = function()
cmd("Ask", function()
M.ask()
end, { desc = "avante: ask AI for code suggestions" })
cmd("Close", function()
local sidebar, _ = M._get()
if not sidebar then
return
end
sidebar:close()
end, { desc = "avante: close chat window" })
cmd("Edit", function()
M.edit()
end, { desc = "avante: edit selected block" })
@@ -61,21 +54,23 @@ H.keymaps = function()
M.toggle.hint()
end)
Utils.safe_keymap_set({ "n", "v" }, Config.mappings.ask, function()
M.ask()
end, { desc = "avante: ask" })
Utils.safe_keymap_set("v", Config.mappings.edit, function()
M.edit()
end, { desc = "avante: edit" })
Utils.safe_keymap_set("n", Config.mappings.refresh, function()
M.refresh()
end, { desc = "avante: refresh" })
Utils.safe_keymap_set("n", Config.mappings.toggle.debug, function()
M.toggle.debug()
end, { desc = "avante: toggle debug" })
Utils.safe_keymap_set("n", Config.mappings.toggle.hint, function()
M.toggle.hint()
end, { desc = "avante: toggle hint" })
if Config.behaviour.auto_set_keymaps then
Utils.safe_keymap_set({ "n", "v" }, Config.mappings.ask, function()
M.ask()
end, { desc = "avante: ask" })
Utils.safe_keymap_set("v", Config.mappings.edit, function()
M.edit()
end, { desc = "avante: edit" })
Utils.safe_keymap_set("n", Config.mappings.refresh, function()
M.refresh()
end, { desc = "avante: refresh" })
Utils.safe_keymap_set("n", Config.mappings.toggle.debug, function()
M.toggle.debug()
end, { desc = "avante: toggle debug" })
Utils.safe_keymap_set("n", Config.mappings.toggle.hint, function()
M.toggle.hint()
end, { desc = "avante: toggle hint" })
end
end
---@class ApiCaller