diff --git a/lua/avante/init.lua b/lua/avante/init.lua index 86cd4ff..cf882b9 100644 --- a/lua/avante/init.lua +++ b/lua/avante/init.lua @@ -67,6 +67,7 @@ H.commands = function() return vim.tbl_filter(function(key) return key:find(prefix, 1, true) == 1 end, Config.providers) end, }) + cmd("Clear", function() require("avante.path").clear() end, { desc = "avante: clear all chat history" }) end H.keymaps = function() diff --git a/lua/avante/path.lua b/lua/avante/path.lua index ba21939..82c4f7d 100644 --- a/lua/avante/path.lua +++ b/lua/avante/path.lua @@ -143,6 +143,9 @@ end P.available = function() return templates ~= nil end -P.clear = function() P.cache_path:rm({ recursive = true }) end +P.clear = function() + P.cache_path:rm({ recursive = true }) + P.history_path:rm({ recursive = true }) +end return P