diff options
Diffstat (limited to 'modules/by-name/nv/nvim/plgs/treesitter')
| -rw-r--r-- | modules/by-name/nv/nvim/plgs/treesitter/default.nix | 44 |
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"} |
