diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 1144000..ece841e 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -75,8 +75,10 @@ end, { desc = "Toggle Explorer" }) -- Configure toggle terminal for CMD+J map({ "n", "t" }, "", function() - Snacks.terminal(nil, { cwd = LazyVim.root() }) -end, { desc = "Terminal (Root Dir)" }) + -- Use git root (stable) instead of LazyVim.root(), which changes once an LSP + -- attaches and would open a second terminal instance instead of toggling. + Snacks.terminal(nil, { cwd = LazyVim.root.git() }) +end, { desc = "Terminal (Git Root)" }) map("n", "cD", "%s/\\s\\+$//e", { desc = "Delete trailing spaces" })