mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 11:06:54 -04:00
docs: document setting foldmethod alongside foldexpr (#8187)
This commit is contained in:
parent
e527584cf8
commit
c5623d3486
2 changed files with 2 additions and 0 deletions
|
|
@ -101,6 +101,7 @@ Treesitter-based folding is provided by Neovim. To enable it, put the following
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
||||||
|
vim.wo.foldmethod = 'expr'
|
||||||
```
|
```
|
||||||
|
|
||||||
## Indentation
|
## Indentation
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ Treesitter features for installed languages need to be enabled manually in a
|
||||||
vim.treesitter.start()
|
vim.treesitter.start()
|
||||||
-- folds, provided by Neovim
|
-- folds, provided by Neovim
|
||||||
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
||||||
|
vim.wo.foldmethod = 'expr'
|
||||||
-- indentation, provided by nvim-treesitter
|
-- indentation, provided by nvim-treesitter
|
||||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue