Add left right keymaps to always open folds

This commit is contained in:
Valentin Degenne 2024-09-17 20:42:04 +02:00 committed by GitHub
parent 4cb12312cf
commit 69bf1fc4cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,6 +10,10 @@ map({ "n", "x" }, "<Down>", "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" }, "<Up>", "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 <ctrl> hjkl keys
map("n", "<C-h>", "<C-w>h", { desc = "Go to Left Window", remap = true })
map("n", "<C-j>", "<C-w>j", { desc = "Go to Lower Window", remap = true })