mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-16 04:14:37 +02:00
feat(options): enabled treesitter folding and foldtext when available
This commit is contained in:
parent
450e0c6beb
commit
19926d2848
1 changed files with 12 additions and 0 deletions
|
@ -51,5 +51,17 @@ if vim.fn.has("nvim-0.10") == 1 then
|
|||
opt.smoothscroll = true
|
||||
end
|
||||
|
||||
-- Folding
|
||||
vim.opt.foldlevel = 99
|
||||
if vim.treesitter.foldexpr then
|
||||
vim.opt.foldmethod = "expr"
|
||||
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||
else
|
||||
vim.opt.foldmethod = "indent"
|
||||
end
|
||||
if vim.treesitter.foldtext then
|
||||
vim.opt.foldtext = "v:lua.vim.treesitter.foldtext()"
|
||||
end
|
||||
|
||||
-- Fix markdown indentation settings
|
||||
vim.g.markdown_recommended_style = 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue