Compare commits

..

1 Commits

Author SHA1 Message Date
László Párkányi
90aa0c5868 fix(nvim): elegant fold configuration 2026-01-06 15:09:17 +01:00

View File

@@ -6,8 +6,27 @@ local autocmd = vim.api.nvim_create_autocmd
-- command = "tabdo wincmd =", -- command = "tabdo wincmd =",
-- }) -- })
-- Auto unfold all when entering a buffer autocmd({ "FileType" }, {
-- autocmd("BufWinEnter", { pattern = "*", command = "silent! :%foldopen!" }) callback = function()
-- check if treesitter has parser
if require("nvim-treesitter.parsers").has_parser() then
-- use treesitter folding
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
else
-- use alternative foldmethod
vim.opt.foldmethod = "syntax"
end
end,
})
-- disable folding on startup
vim.opt.foldenable = false
-- disable folding on loading
vim.opt.foldlevel = 20
-- Hyrplang filetype -- Hyrplang filetype
vim.filetype.add({ vim.filetype.add({