aboutsummaryrefslogtreecommitdiffstats
path: root/modules/by-name/nv/nvim/plgs/treesitter
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-01-18 18:50:19 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-01-18 18:54:14 +0100
commit2215dbfa350fad76765c348d4710aab05de719c2 (patch)
treecf6c22bf0ea6226510174233de5bf718a8441037 /modules/by-name/nv/nvim/plgs/treesitter
parentmodules/adb: Remove deprecated `programs.adb` (diff)
downloadnixos-config-2215dbfa350fad76765c348d4710aab05de719c2.zip
modules/nvim: Update to the newest tree-sitter version
This includes quite a big collection of breaking changes, and as I can't have the same plugin twice in the `buildEnv` scope, some plugins (e.g. neorg and femacro) needed to be deactivated.
Diffstat (limited to '')
-rw-r--r--modules/by-name/nv/nvim/plgs/treesitter/default.nix44
1 files changed, 11 insertions, 33 deletions
diff --git a/modules/by-name/nv/nvim/plgs/treesitter/default.nix b/modules/by-name/nv/nvim/plgs/treesitter/default.nix
index ed1499f8..ae4cc173 100644
--- a/modules/by-name/nv/nvim/plgs/treesitter/default.nix
+++ b/modules/by-name/nv/nvim/plgs/treesitter/default.nix
@@ -26,45 +26,23 @@ in {
plugins.treesitter = {
enable = true;
+ highlight.enable = true;
+ indent.enable = true;
+ folding.enable = true;
+
# inject nixvim specific highlighting (eg in extraConfigLua).
nixvimInjections = true;
- nixGrammars = true;
- grammarPackages =
- # Append the `tree-sitter-yts` grammar to all the other grammars.
- # TODO: Find a better way to do this. <2024-11-08>
- config.home-manager.users.soispha.programs.nixvim.plugins.treesitter.package.passthru.allGrammars
- ++ [pkgs.tree-sitter-yts];
-
- settings = {
- auto_install = false;
- ensureInstalled = "all";
- indent.enable = true;
- disabledLanguages = [];
+ grammarPackages = pkgs.vimPlugins.nvim-treesitter.allGrammars ++ [pkgs.tree-sitter-yts];
- highlight = {
- enable = true;
- disable = [];
+ # Register the parser to filetype
+ languageRegister.yts = "yts";
+ };
- # Setting this to true will run `:h syntax` and tree-sitter at the same time.
- # Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
- # Using this option may slow down your editor; and you may see some duplicate highlights.
- # Instead of true it can also be a list of languages
- additionalVimRegexHighlighting = [];
- };
+ # TODO: Is that necessary? <2026-01-18>
+ # extraPlugins = [pkgs.tree-sitter-yts];
- incrementalSelection = {
- enable = true;
- keymaps = {
- # TODO: include these in the which-key description
- initSelection = "gnn"; # set to `false` to disable one of the mappings
- nodeIncremental = "grn";
- scopeIncremental = "grc";
- nodeDecremental = "grm";
- };
- };
- };
- };
+ # TODO: Remove this by moving the queries in the package to `queries/<lang>/...`' <2026-01-18>
extraFiles = {
"queries/yts/highlights.scm".text = ''
${lib.strings.fileContents "${pkgs.tree-sitter-yts}/queries/highlights.scm"}