2023-07-04 17:09:25 +00:00
|
|
|
local ufo = require("ufo")
|
|
|
|
|
|
|
|
ufo.setup({
|
2023-07-03 17:16:19 +00:00
|
|
|
provider_selector = function(bufnr, filetype, buftype)
|
|
|
|
return { "treesitter", "indent" }
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
local keymap = vim.keymap.set
|
2023-07-06 18:35:18 +00:00
|
|
|
|
|
|
|
keymap("n", "zR", ufo.openAllFolds, { desc = "Open all folds" })
|
|
|
|
keymap("n", "zM", ufo.closeAllFolds, { desc = "Close all folds" })
|
2023-07-04 17:09:25 +00:00
|
|
|
keymap("n", "zr", ufo.openFoldsExceptKinds, { desc = "Fold less" })
|
|
|
|
keymap("n", "zm", ufo.closeFoldsWith, { desc = "Fold more" })
|
|
|
|
keymap("n", "zp", ufo.peekFoldedLinesUnderCursor, { desc = "Peek fold" })
|