nixvim-for-share/config/json-foldable.nix
2025-07-26 12:43:01 +00:00

27 lines
625 B
Nix

{
autoGroups = {
json-foldable = {
clear = true;
};
};
autoCmd = [
{
pattern = [ "*.json" ];
event = [
"BufRead"
"BufNewFile"
];
desc = "Available to make json files foldable";
group = "json-foldable";
# https://vi.stackexchange.com/questions/10562/how-to-fold-text-in-a-json-file
callback.__raw = ''
function()
vim.o.foldmethod = "expr"
vim.o.foldexpr = "nvim_treesitter#foldexpr()"
-- vim.o.foldlevelstart not working for unknown reason
vim.o.foldlevel = 99
end
'';
}
];
}