From 100d9e59a1a6a1ec78abba4d906e86e76ba871b5 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 27 Jan 2026 16:10:19 +0300 Subject: [PATCH] Revert "treesitter: move autogroup definition to augroup module" This reverts commit 33cc70b4db47a13383606fd997579110b146c936. Signed-off-by: NotAShelf Change-Id: Ida7d935c48909fdfa9978b6e199f222a6a6a6964 --- modules/plugins/treesitter/config.nix | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/modules/plugins/treesitter/config.nix b/modules/plugins/treesitter/config.nix index ab7d2cae..899e7c19 100644 --- a/modules/plugins/treesitter/config.nix +++ b/modules/plugins/treesitter/config.nix @@ -21,18 +21,9 @@ in { treesitter.grammars = optionals cfg.addDefaultGrammars cfg.defaultGrammars; - # Define the autogroup for treesitter here rather than in the Lua snippet - # to allow overriding more easily. Should be highly unlikely that a user - # wants to override, but not impossible. - augroups = [ - { - enable = true; - name = "nvf_treesitter"; - clear = true; - } - ]; - pluginRC.treesitter-autocommands = entryAfter ["basic"] '' + vim.api.nvim_create_augroup("nvf_treesitter", { clear = true }) + ${lib.optionalString cfg.highlight.enable '' -- Enable treesitter highlighting for all filetypes vim.api.nvim_create_autocmd("FileType", { @@ -63,7 +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