update folding settings

This commit is contained in:
Thomas Ruoff
2025-11-25 08:02:06 +01:00
parent 96665ab09d
commit 1f9516ad6f
2 changed files with 8 additions and 11 deletions

View File

@@ -36,3 +36,11 @@ vim.opt.scrolloff = 10
vim.o.laststatus = 3 vim.o.laststatus = 3
vim.opt.confirm = true vim.opt.confirm = true
-- Treesitter-based folding
vim.opt.foldmethod = 'expr'
vim.opt.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
vim.opt.foldlevel = 99 -- Start with all folds open
vim.opt.foldlevelstart = 99
vim.opt.foldenable = true
vim.opt.foldcolumn = '1' -- Show fold column

View File

@@ -6,15 +6,4 @@ return {
---@module 'render-markdown' ---@module 'render-markdown'
---@type render.md.UserConfig ---@type render.md.UserConfig
opts = {}, opts = {},
init = function()
vim.api.nvim_create_autocmd('FileType', {
group = vim.api.nvim_create_augroup('markdown.fold', {}),
pattern = 'markdown',
callback = function()
-- sets local folding options for markdown
vim.opt_local.foldmethod = 'expr'
vim.opt_local.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
end,
})
end,
} }