feat(options): enabled treesitter folding and foldtext when available
This commit is contained in:
@ -51,5 +51,17 @@ if vim.fn.has("nvim-0.10") == 1 then
|
|||||||
opt.smoothscroll = true
|
opt.smoothscroll = true
|
||||||
end
|
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
|
-- Fix markdown indentation settings
|
||||||
vim.g.markdown_recommended_style = 0
|
vim.g.markdown_recommended_style = 0
|
||||||
|
Reference in New Issue
Block a user