From 52bf23149e6149345591e1569c656bfc40b4d620 Mon Sep 17 00:00:00 2001 From: heliosran <264772879+heliosran@users.noreply.github.com> Date: Mon, 16 Mar 2026 10:28:43 +0000 Subject: [PATCH 1/3] treesitter: make foldenable configurable --- modules/plugins/treesitter/config.nix | 2 +- modules/plugins/treesitter/treesitter.nix | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/plugins/treesitter/config.nix b/modules/plugins/treesitter/config.nix index 899e7c190..682594100 100644 --- a/modules/plugins/treesitter/config.nix +++ b/modules/plugins/treesitter/config.nix @@ -57,7 +57,7 @@ in { -- This is optional, but is set rather as a sane default. -- If unset, opened files will be folded by automatically as -- the files are opened - vim.o.foldenable = false + vim.o.foldenable = ${if cfg.foldEnable then "true" else "false"} end, }) ''} diff --git a/modules/plugins/treesitter/treesitter.nix b/modules/plugins/treesitter/treesitter.nix index c2039a9fa..6d322d2e3 100644 --- a/modules/plugins/treesitter/treesitter.nix +++ b/modules/plugins/treesitter/treesitter.nix @@ -10,6 +10,11 @@ in { enable = mkEnableOption "treesitter, also enabled automatically through language options"; fold = mkEnableOption "fold with treesitter"; + foldEnable = mkOption { + type = bool; + default = false; + description = "Whether folds should be enabled when treesitter folding is configured."; + }; autotagHtml = mkEnableOption "autoclose and rename html tag"; grammars = mkOption { From fc9477ce1a932597b2744cb7c0a7a1dc67beddbb Mon Sep 17 00:00:00 2001 From: heliosran <264772879+heliosran@users.noreply.github.com> Date: Mon, 16 Mar 2026 10:37:39 +0000 Subject: [PATCH 2/3] treesitter: remove stale foldenable comment --- modules/plugins/treesitter/config.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/plugins/treesitter/config.nix b/modules/plugins/treesitter/config.nix index 682594100..a0f025034 100644 --- a/modules/plugins/treesitter/config.nix +++ b/modules/plugins/treesitter/config.nix @@ -54,9 +54,6 @@ in { callback = function() vim.wo[0][0].foldmethod = "expr" vim.wo[0][0].foldexpr = "v:lua.vim.treesitter.foldexpr()" - -- This is optional, but is set rather as a sane default. - -- If unset, opened files will be folded by automatically as - -- the files are opened vim.o.foldenable = ${if cfg.foldEnable then "true" else "false"} end, }) From 99757303d79cfc88ae64c6f93f66edbc6318a3b8 Mon Sep 17 00:00:00 2001 From: heliosran <264772879+heliosran@users.noreply.github.com> Date: Mon, 16 Mar 2026 10:40:30 +0000 Subject: [PATCH 3/3] treesitter: use mkEnableOption for foldEnable --- modules/plugins/treesitter/treesitter.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/plugins/treesitter/treesitter.nix b/modules/plugins/treesitter/treesitter.nix index 6d322d2e3..7376dc88f 100644 --- a/modules/plugins/treesitter/treesitter.nix +++ b/modules/plugins/treesitter/treesitter.nix @@ -10,11 +10,7 @@ in { enable = mkEnableOption "treesitter, also enabled automatically through language options"; fold = mkEnableOption "fold with treesitter"; - foldEnable = mkOption { - type = bool; - default = false; - description = "Whether folds should be enabled when treesitter folding is configured."; - }; + foldEnable = mkEnableOption "folds when treesitter folding is configured"; autotagHtml = mkEnableOption "autoclose and rename html tag"; grammars = mkOption {