diff --git a/pkgsets/nvim/treesitter.nix b/pkgsets/nvim/treesitter.nix index d17e075..aa5f047 100644 --- a/pkgsets/nvim/treesitter.nix +++ b/pkgsets/nvim/treesitter.nix @@ -17,35 +17,36 @@ lib.mkIf (lib.elem "nvim::treesitter" config.machine.pkgs) { [ { lazy = false; - dir = treesitter; + dir = _: treesitter; event = [ "BufReadPost" "BufWritePost" "BufNewFile" "VeryLazy" ]; + opts = { + auto_install = false; + highlight = { + enable = true; + }; + incremental_selection = { + enable = true; + keymaps = { + init_selection = "gnn"; # set to `false` to disable one of the mappings + node_incremental = "grn"; + scope_incremental = "grc"; + node_decremental = "grm"; + }; + }; + indent = { + enable = true; + }; + }; config = # lua '' - function() + function(_, opts) vim.opt.rtp:prepend("${grammars}") - require("nvim-treesitter.configs").setup({ - auto_install = false, - highlight = { - enable = true, - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "gnn", -- set to `false` to disable one of the mappings - node_incremental = "grn", - scope_incremental = "grc", - node_decremental = "grm", - }, - }, - indent = { - enable = true - } - }) + require("nvim-treesitter.configs").setup(opts) end ''; }