Add nvim-ufo for fancier folding
This commit is contained in:
33
lua/plugins/folding.lua
Normal file
33
lua/plugins/folding.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
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,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user