This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/Blovio on 2024-11-02 22:12:09+00:00.


I’m just starting to learn the power of treesitter and my new favorite thing is having the file automatically make auto-foldable sections on the whole file, then close and open them with the normal fold commands, especially when working in large functions or nested conditionals.

vim.o.foldmethod = 'expr'
vim.o.foldexpr = 'nvim\_treesitter#foldexpr()'
vim.o.foldlevelstart = 99 

These three lines completely replaced nvim-ufo for me, which I loved using for a while! Thought i’d share.