dotfiles/home/.config/nvim/lua/plugins/ufo.lua

29 lines
615 B
Lua
Raw Normal View History

-- Better folds
2023-11-25 14:37:36 +02:00
--- @type LazyPluginSpec
return {
"kevinhwang91/nvim-ufo",
dependencies = { "kevinhwang91/promise-async" },
2023-11-25 14:37:36 +02:00
--- @type UfoConfig
opts = {
2023-09-20 16:23:52 +03:00
close_fold_kinds = {
"imports",
},
},
2023-11-25 14:37:36 +02:00
--- @param opts UfoConfig
2023-11-18 02:54:35 +02:00
config = function(_, opts)
local ufo = require("ufo")
2023-11-18 02:54:35 +02:00
ufo.setup(opts)
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)
-- Fold settings
local o = vim.o
o.foldcolumn = "1"
o.foldlevel = 99
o.foldlevelstart = 99
o.foldenable = true
end,
}