2023-11-18 02:27:14 +02:00
|
|
|
-- Better folds
|
2023-11-25 14:37:36 +02:00
|
|
|
--- @type LazyPluginSpec
|
2023-11-18 02:27:14 +02:00
|
|
|
return {
|
|
|
|
"kevinhwang91/nvim-ufo",
|
|
|
|
dependencies = { "kevinhwang91/promise-async" },
|
2023-11-25 14:37:36 +02:00
|
|
|
--- @type UfoConfig
|
2023-11-18 02:27:14 +02:00
|
|
|
opts = {
|
2023-09-20 16:23:52 +03:00
|
|
|
close_fold_kinds = {
|
|
|
|
"imports",
|
|
|
|
},
|
2023-11-18 02:27:14 +02:00
|
|
|
},
|
2023-11-25 14:37:36 +02:00
|
|
|
--- @param opts UfoConfig
|
2023-11-18 02:54:35 +02:00
|
|
|
config = function(_, opts)
|
2023-11-18 02:27:14 +02:00
|
|
|
local ufo = require("ufo")
|
2023-11-18 02:54:35 +02:00
|
|
|
ufo.setup(opts)
|
2023-11-17 08:01:52 +02:00
|
|
|
|
2023-11-21 07:52:05 +02:00
|
|
|
-- Using ufo, we need to remap `zR` and `zM`
|
|
|
|
vim.keymap.set("n", "zR", ufo.openAllFolds)
|
|
|
|
vim.keymap.set("n", "zM", ufo.closeAllFolds)
|
2023-11-17 08:01:52 +02:00
|
|
|
|
2023-11-18 02:27:14 +02:00
|
|
|
-- Fold settings
|
|
|
|
local o = vim.o
|
2023-11-21 22:32:32 +02:00
|
|
|
o.foldcolumn = "1"
|
2023-11-18 02:27:14 +02:00
|
|
|
o.foldlevel = 99
|
|
|
|
o.foldlevelstart = 99
|
|
|
|
o.foldenable = true
|
|
|
|
end,
|
|
|
|
}
|