local ufo = require "ufo" local ts_parsers = require "nvim-treesitter.parsers" local map = vim.api.nvim_set_keymap ufo.setup { open_fold_hl_timeout = 0, -- disable blinky thingy when opening fold provider_selector = function(_, ft, _) if ts_parsers.has_parser(ft) then return { "lsp", "treesitter" } else return { "lsp", "indent" } end end, } -- https://github.com/neovim/neovim/pull/17446 --vim.o.foldcolumn = "1" --vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]] vim.o.foldcolumn = "0" vim.o.foldlevel = 256 vim.o.foldlevelstart = 256 vim.o.foldenable = true local map_opts = { noremap = true, silent = true, } map("n", "t", "za", map_opts) -- toggle fold map("n", "zO", [[lua require("ufo").openAllFolds()]], map_opts) map("n", "zC", [[lua require("ufo").closeAllFolds()]], map_opts)