1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

Update nvim-ufo settings

This commit is contained in:
jdhao 2024-08-06 17:58:05 +02:00
parent 8af8ebd72a
commit fd6df981cd
2 changed files with 8 additions and 4 deletions

View File

@ -110,6 +110,11 @@ local custom_attach = function(client, bufnr)
end
local capabilities = require('cmp_nvim_lsp').default_capabilities()
-- required by nvim-ufo
capabilities.textDocument.foldingRange = {
dynamicRegistration = false,
lineFoldingOnly = true
}
local lspconfig = require("lspconfig")

View File

@ -30,10 +30,9 @@ local handler = function(virtText, lnum, endLnum, width, truncate)
return newVirtText
end
local opts = {}
opts["fold_virt_text_handler"] = handler
require("ufo").setup(opts)
require("ufo").setup {
fold_virt_text_handler = handler,
}
vim.keymap.set("n", "zR", require("ufo").openAllFolds)
vim.keymap.set("n", "zM", require("ufo").closeAllFolds)