diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-01-18 18:50:19 +0100 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-01-18 18:54:14 +0100 |
| commit | 2215dbfa350fad76765c348d4710aab05de719c2 (patch) | |
| tree | cf6c22bf0ea6226510174233de5bf718a8441037 /modules | |
| parent | modules/adb: Remove deprecated `programs.adb` (diff) | |
| download | nixos-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 'modules')
| -rw-r--r-- | modules/by-name/nv/nvim/plgs/femaco/default.nix | 3 | ||||
| -rw-r--r-- | modules/by-name/nv/nvim/plgs/neorg/default.nix | 4 | ||||
| -rw-r--r-- | modules/by-name/nv/nvim/plgs/treesitter/default.nix | 44 | ||||
| -rw-r--r-- | modules/by-name/nv/nvim/plgs/vim-tex/default.nix | 5 |
4 files changed, 19 insertions, 37 deletions
diff --git a/modules/by-name/nv/nvim/plgs/femaco/default.nix b/modules/by-name/nv/nvim/plgs/femaco/default.nix index 0388844a..eac6b393 100644 --- a/modules/by-name/nv/nvim/plgs/femaco/default.nix +++ b/modules/by-name/nv/nvim/plgs/femaco/default.nix @@ -14,7 +14,8 @@ }: let cfg = config.soispha.programs.nvim; in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { + # TODO: Re-active this plugin, when it does no longer depend on `treesitter-legacy` <2026-01-18> + home-manager.users.soispha.programs.nixvim = lib.mkIf false { plugins.femaco = { enable = true; }; diff --git a/modules/by-name/nv/nvim/plgs/neorg/default.nix b/modules/by-name/nv/nvim/plgs/neorg/default.nix index ea451d3a..5ed87f0e 100644 --- a/modules/by-name/nv/nvim/plgs/neorg/default.nix +++ b/modules/by-name/nv/nvim/plgs/neorg/default.nix @@ -14,7 +14,9 @@ }: let cfg = config.soispha.programs.nvim; in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { + # TODO: Re-active, whence neorg actually builds with all the treesitter grammars + # activated <2026-01-18> + home-manager.users.soispha.programs.nixvim = lib.mkIf false { extraFiles = { "ftplugin/norg.lua".text = '' ${lib.strings.fileContents ./key_mappings.lua} 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"} diff --git a/modules/by-name/nv/nvim/plgs/vim-tex/default.nix b/modules/by-name/nv/nvim/plgs/vim-tex/default.nix index 9ee657c3..71422f94 100644 --- a/modules/by-name/nv/nvim/plgs/vim-tex/default.nix +++ b/modules/by-name/nv/nvim/plgs/vim-tex/default.nix @@ -14,11 +14,12 @@ }: let cfg = config.soispha.programs.nvim; in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { + # TODO: Do I still need this module at all? <2026-01-18> + home-manager.users.soispha.programs.nixvim = lib.mkIf false { opts.conceallevel = 0; plugins.vimtex = { - enable = false; + enable = true; settings = { view_method = "zathura"; quickfix_mode = -1; |
