From 69bf1fc4cffbc5962edb9d396c39883169d19303 Mon Sep 17 00:00:00 2001 From: Valentin Degenne Date: Tue, 17 Sep 2024 20:42:04 +0200 Subject: [PATCH] Add left right keymaps to always open folds --- lua/lazyvim/config/keymaps.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index a6f1c574..80a9da6a 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -10,6 +10,10 @@ map({ "n", "x" }, "", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true }) map({ "n", "x" }, "", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true }) +-- Open folds on left/right +map("n", "h", "foldclosed('.') > 0 ? 'zoh' : 'h'", { expr = true, silent = true }) +map("n", "l", "foldclosed('.') > 0 ? 'zol' : 'l'", { expr = true, silent = true }) + -- Move to window using the hjkl keys map("n", "", "h", { desc = "Go to Left Window", remap = true }) map("n", "", "j", { desc = "Go to Lower Window", remap = true })