mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-13 17:00:09 -04:00
docs(readme): recommend builtin foldexpr
This commit is contained in:
parent
804a6473df
commit
dd7bb795c4
1 changed files with 4 additions and 5 deletions
|
|
@ -537,12 +537,11 @@ require'nvim-treesitter.configs'.setup {
|
||||||
|
|
||||||
#### Folding
|
#### Folding
|
||||||
|
|
||||||
Tree-sitter based folding. _(Technically not a module because it's per windows and not per buffer.)_
|
Tree-sitter based folding (implemented in Neovim itself, see `:h vim.treesitter.foldexpr()`). To enable it for the current window, set
|
||||||
|
|
||||||
```vim
|
```lua
|
||||||
set foldmethod=expr
|
vim.wo.foldmethod = 'expr'
|
||||||
set foldexpr=nvim_treesitter#foldexpr()
|
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
||||||
set nofoldenable " Disable folding at startup.
|
|
||||||
```
|
```
|
||||||
|
|
||||||
This will respect your `foldminlines` and `foldnestmax` settings.
|
This will respect your `foldminlines` and `foldnestmax` settings.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue