From 0bf81b97cb7653541adbca7173643ab347c1d37f Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Thu, 19 Jun 2025 19:02:50 +0100 Subject: [PATCH] ufo --- lua/plugins/editing.lua | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/lua/plugins/editing.lua b/lua/plugins/editing.lua index 2dd1c7f..0690fe3 100644 --- a/lua/plugins/editing.lua +++ b/lua/plugins/editing.lua @@ -45,6 +45,41 @@ return { }, }, + { + "kevinhwang91/nvim-ufo", + dependencies = { "kevinhwang91/promise-async" }, + config = function() + vim.o.foldcolumn = "1" -- '0' is not bad + vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value + vim.o.foldlevelstart = 99 + vim.o.foldenable = true + + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities.textDocument.foldingRange = { + dynamicRegistration = false, + lineFoldingOnly = true, + } + require("ufo").setup() + end, + + keys = { + { + "zR", + function() + require("ufo").openAllFolds() + end, + desc = "Open all folds", + }, + { + "zM", + function() + require("ufo").closeAllFolds() + end, + desc = "Close all folds", + }, + }, + }, + -- { -- "tzachar/local-highlight.nvim", -- event = "VeryLazy",