mirror of
https://github.com/hazemKrimi/config.nvim.git
synced 2026-05-01 18:20:26 +00:00
feat: treesitter folding config autocommand
This commit is contained in:
@@ -57,3 +57,16 @@ vim.api.nvim_create_autocmd("BufWritePre", {
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Folding config
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
callback = function()
|
||||||
|
if require("nvim-treesitter.parsers").has_parser() then
|
||||||
|
vim.opt.foldmethod = "expr"
|
||||||
|
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||||
|
else
|
||||||
|
vim.opt.foldmethod = "syntax"
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user