1
0
Fork 0

ultra folding experience

This commit is contained in:
zymon 2024-08-27 15:42:44 +02:00
parent 1e2a6dc5d2
commit 59d604091e
2 changed files with 20 additions and 0 deletions

View file

@ -37,3 +37,7 @@ vim.keymap.set("n", "<S-h>", "<cmd>bprevious<cr>", { desc = "prev buffer" })
vim.keymap.set("n", "<S-l>", "<cmd>bnext<cr>", { desc = "next buffer" }) vim.keymap.set("n", "<S-l>", "<cmd>bnext<cr>", { desc = "next buffer" })
vim.keymap.set("n", "[b", "<cmd>bprevious<cr>", { desc = "prev buffer" }) vim.keymap.set("n", "[b", "<cmd>bprevious<cr>", { desc = "prev buffer" })
vim.keymap.set("n", "]b", "<cmd>bnext<cr>", { desc = "next buffer" }) vim.keymap.set("n", "]b", "<cmd>bnext<cr>", { desc = "next buffer" })
vim.keymap.set("n", "<leader>uf", function ()
vim.opt.foldcolumn = vim.opt.foldcolumn:get() == "0" and "4" or "0"
end, { desc = "toggle fold column" })

View file

@ -119,4 +119,20 @@ return {
}, },
}, },
{ -- better folding
"https://github.com/kevinhwang91/nvim-ufo",
dependencies = {
"https://github.com/kevinhwang91/promise-async",
},
event = "BufReadPost",
config = function()
local ufo = require("ufo")
-- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself
vim.keymap.set("n", "zR", ufo.openAllFolds)
vim.keymap.set("n", "zM", ufo.closeAllFolds)
ufo.setup()
end,
},
} }