Skip to content

Commit 5797dbd

Browse files
committed
fix(folding): use treesitter as source for folding
<https://www.jackfranklin.co.uk/blog/code-folding-in-vim-neovim/>
1 parent 07ae51c commit 5797dbd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lua/options.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,11 @@ o.undolevels = 1000
137137
o.undoreload = 10000
138138

139139
-- fold
140-
o.foldmethod = "marker"
140+
o.foldexpr = "v:lua.vim.treesitter.foldexpr()"
141+
o.foldmethod = "expr"
141142
o.foldlevel = 99
143+
o.foldnestmax = 10
144+
o.foldtext = ""
142145

143146
-- Disable builtin plugins
144147
local disabled_built_ins = {

0 commit comments

Comments
 (0)