neovim-config/lua/plugins/folding.lua

34 lines
746 B
Lua
Raw Normal View History

2023-12-01 20:26:02 +00:00
return {
-- add folding range to capabilities
{
"neovim/nvim-lspconfig",
opts = {
capabilities = {
textDocument = {
foldingRange = {
dynamicRegistration = false,
lineFoldingOnly = true,
},
},
},
},
},
-- add nvim-ufo
{
"kevinhwang91/nvim-ufo",
dependencies = "kevinhwang91/promise-async",
event = "BufReadPost",
opts = {},
init = function()
-- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself
vim.keymap.set("n", "zR", function()
require("ufo").openAllFolds()
end)
vim.keymap.set("n", "zM", function()
require("ufo").closeAllFolds()
end)
end,
},
}