From af01354af90a57f74ca78ec1fd49a93c408abfbd Mon Sep 17 00:00:00 2001 From: zymon Date: Wed, 4 Dec 2024 17:32:24 +0100 Subject: [PATCH] improve folding --- lua/znvim/plugins/editor.lua | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/lua/znvim/plugins/editor.lua b/lua/znvim/plugins/editor.lua index ae8630a..449eb1a 100644 --- a/lua/znvim/plugins/editor.lua +++ b/lua/znvim/plugins/editor.lua @@ -242,7 +242,27 @@ return { "https://github.com/kevinhwang91/promise-async", }, event = "BufReadPost", - config = true, + keys = { + { + "zR", + function () + require('ufo').openAllFolds() + end, + desc = "Open all folds" + }, + { + "zM", + function () + require('ufo').closeAllFolds() + end, + desc = "Close all folds" + }, + }, + config = { + provider_selector = function(bufnr, filetype, buftype) + return {'treesitter', 'indent'} + end + }, }, { -- rainbow delimiters "https://gitlab.com/HiPhish/rainbow-delimiters.nvim",