diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index cee2bc26..2262dbff 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -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