Nvim: enable ufo
This commit is contained in:
parent
2a0d701746
commit
26d0dae2fc
2 changed files with 8 additions and 11 deletions
|
@ -63,10 +63,10 @@ function m.get_capabilities()
|
||||||
)
|
)
|
||||||
|
|
||||||
-- Neovim hasn't added foldingRange to default capabilities, users must add it manually for ufo
|
-- Neovim hasn't added foldingRange to default capabilities, users must add it manually for ufo
|
||||||
--capabilities.textDocument.foldingRange = {
|
capabilities.textDocument.foldingRange = {
|
||||||
-- dynamicRegistration = false,
|
dynamicRegistration = false,
|
||||||
-- lineFoldingOnly = true,
|
lineFoldingOnly = true,
|
||||||
--}
|
}
|
||||||
return capabilities
|
return capabilities
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
-- Better folds
|
-- Better folds
|
||||||
-- Disabled for now because it causes weird artifacts
|
|
||||||
return {
|
return {
|
||||||
enabled = false,
|
|
||||||
"kevinhwang91/nvim-ufo",
|
"kevinhwang91/nvim-ufo",
|
||||||
dependencies = { "kevinhwang91/promise-async" },
|
dependencies = { "kevinhwang91/promise-async" },
|
||||||
opts = {
|
opts = {
|
||||||
|
@ -13,14 +11,13 @@ return {
|
||||||
local ufo = require("ufo")
|
local ufo = require("ufo")
|
||||||
ufo.setup(opts)
|
ufo.setup(opts)
|
||||||
|
|
||||||
-- Using ufo, need to remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself
|
-- Using ufo, we need to remap `zR` and `zM`
|
||||||
local keymap = vim.keymap
|
vim.keymap.set("n", "zR", ufo.openAllFolds)
|
||||||
keymap.set("n", "zR", ufo.openAllFolds)
|
vim.keymap.set("n", "zM", ufo.closeAllFolds)
|
||||||
keymap.set("n", "zM", ufo.closeAllFolds)
|
|
||||||
|
|
||||||
-- Fold settings
|
-- Fold settings
|
||||||
local o = vim.o
|
local o = vim.o
|
||||||
o.foldcolumn = "1"
|
o.foldcolumn = "0"
|
||||||
o.foldlevel = 99
|
o.foldlevel = 99
|
||||||
o.foldlevelstart = 99
|
o.foldlevelstart = 99
|
||||||
o.foldenable = true
|
o.foldenable = true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue