From d377f3432a03f84049d2f1f8218a2a4a96265df4 Mon Sep 17 00:00:00 2001 From: Fabrice Mouhartem Date: Sun, 24 Dec 2023 19:17:20 +0100 Subject: [PATCH] Manage folds --- lua/general-options.lua | 2 ++ lua/mappings.lua | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/lua/general-options.lua b/lua/general-options.lua index d81c3eb..e9538e2 100644 --- a/lua/general-options.lua +++ b/lua/general-options.lua @@ -49,6 +49,8 @@ for _,o in ipairs(set_true) do vim.o[o] = true end +-- folds +vim.g.ip_skipfold=true -- window management vim.o.tw = 80 diff --git a/lua/mappings.lua b/lua/mappings.lua index 5986542..76880e0 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -30,3 +30,9 @@ vim.api.nvim_set_keymap("n", "y", '"+y', {noremap = true, silent = true} vim.api.nvim_set_keymap("v", "y", '"+y', {noremap = true, silent = true}) vim.api.nvim_set_keymap("n", "pp", '"+p', {noremap = true, silent = true}) vim.api.nvim_set_keymap("v", "pp", '"+p', {noremap = true, silent = true}) + +-- z0…z9 to open folds to a certain level + +for i=0,9 do + vim.api.nvim_set_keymap('n', 'z' .. i , ':set fdl=' .. i .. '', {noremap = true, silent = false}) +end