feat(mapping): add tab for opening/closing folds

This commit is contained in:
Fabrice Mouhartem 2025-03-23 12:19:40 +01:00
parent 98f079fb81
commit b0f478ac92
Signed by: fmouhart
GPG Key ID: 2C5033B228CFE4E7

View File

@ -30,10 +30,14 @@ keymap({ "n", "v" }, "<Leader>y", '"+y', { noremap = true, silent = true, desc =
keymap({ "n", "v" }, "<Leader>Y", '"+yg_', { noremap = true, silent = true, desc = "[Y]ank line to system clipboard" })
keymap({ "n", "v" }, "<Leader>p", '"+p', { noremap = true, silent = true, desc = "[P]ast from system clipboard" })
--[[ Folds ]]
-- z0…z9 to open folds to a certain level
for i = 0, 9 do
keymap('n', 'z' .. i, ':set fdl=' .. i .. '<CR>', { noremap = true, silent = false })
end
-- tab for folds management
keymap('n', '<Tab>', 'za', {noremap= true, silent = true, desc = 'Toggle open folds'})
keymap('n', '<S-Tab>', 'zA', {noremap= true, silent = true, desc = 'Toggle open all folds'})
-- in :terminal esc exits edit mode
keymap('t', '<Esc>', '<C-\\><C-n>', { noremap = true, silent = true })