jdhao / nvim-config

A modern Neovim configuration with full battery for Python, Lua, C++, Markdown, LaTeX, and more...
MIT License
3.4k stars 502 forks source link

add nvim-ufo for folding #262

Closed yangrq1018 closed 3 weeks ago

yangrq1018 commented 7 months ago

foldexpr=nvim_treesitter#foldexpr() is unstable and buggy. I spotted a problem with treesitter folding: the foldings are not updated after I changed the file, and I have to :e for the folding structure to reload.

Occasionally the treesitter fold closes the region where I have just editted (in python etc.)

I use kevinhwang91/nvim-ufo for more reliable folding. It can utilize treesitter (or LSP) as its backend, and work with the default foldexpr=manual. More customization is also available, such as getting a foldcolumn like VSCode.

jdhao commented 3 weeks ago

@yangrq1018 support for ufo is added https://github.com/jdhao/nvim-config/commit/69643e143a72f7e98015f61faba2f2a428d9c79a