From 6b0a2f4c1eb5ee644654f123cfda52ffa7714e88 Mon Sep 17 00:00:00 2001 From: zymon Date: Tue, 27 Aug 2024 15:42:44 +0200 Subject: [PATCH] ultra folding experience --- lua/znvim/keymaps.lua | 4 ++++ lua/znvim/plugins/editor.lua | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/lua/znvim/keymaps.lua b/lua/znvim/keymaps.lua index 24f52fc..3a4a66b 100644 --- a/lua/znvim/keymaps.lua +++ b/lua/znvim/keymaps.lua @@ -37,3 +37,7 @@ vim.keymap.set("n", "", "bprevious", { desc = "prev buffer" }) vim.keymap.set("n", "", "bnext", { desc = "next buffer" }) vim.keymap.set("n", "[b", "bprevious", { desc = "prev buffer" }) vim.keymap.set("n", "]b", "bnext", { desc = "next buffer" }) + +vim.keymap.set("n", "uf", function () + vim.opt.foldcolumn = vim.opt.foldcolumn:get() == "0" and "4" or "0" +end, { desc = "toggle fold column" }) diff --git a/lua/znvim/plugins/editor.lua b/lua/znvim/plugins/editor.lua index e83c3b3..b28a1f9 100644 --- a/lua/znvim/plugins/editor.lua +++ b/lua/znvim/plugins/editor.lua @@ -119,4 +119,14 @@ return { }, }, + + { -- better folding + "https://github.com/kevinhwang91/nvim-ufo", + dependencies = { + "https://github.com/kevinhwang91/promise-async", + }, + event = "BufReadPost", + config = true, + }, + }