Setup treesitter folds in treesitter plugin init

This commit is contained in:
Dreaded_X 2025-05-31 01:04:55 +02:00
parent 2e4796d7a7
commit 82f6744c2f
Signed by: Dreaded_X
GPG Key ID: 5A0CBFE3C3377FAA
2 changed files with 4 additions and 2 deletions

View File

@ -65,8 +65,6 @@ vim.o.listchars = "trail:~,tab:¦⁃,nbsp:␣"
vim.o.list = true vim.o.list = true
-- Fold settings -- Fold settings
vim.wo.foldmethod = "expr"
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
vim.o.foldlevelstart = 99 vim.o.foldlevelstart = 99
-- Windows borders -- Windows borders

View File

@ -12,6 +12,10 @@ return {
branch = "master", branch = "master",
build = ":TSUpdate", build = ":TSUpdate",
main = "nvim-treesitter.configs", main = "nvim-treesitter.configs",
init = function()
vim.wo.foldmethod = "expr"
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
end,
--- @module "nvim-treesitter" --- @module "nvim-treesitter"
--- @type TSConfig --- @type TSConfig
opts = { opts = {