Vim sort of already has this feature via set foldmethod=syntax. This doesn’t work exactly like the author suggests but you can also use set foldmethod=expr and then set foldexpr to a more complicated expression to only get nested function/method bodies, via tree sitter for example if you’re on neovim.
Vim sort of already has this feature via
set foldmethod=syntax
. This doesn’t work exactly like the author suggests but you can also useset foldmethod=expr
and then setfoldexpr
to a more complicated expression to only get nested function/method bodies, via tree sitter for example if you’re on neovim.