nvim: move treesitter config into opts

This commit is contained in:
Kevin Baensch 2025-07-02 15:56:09 +02:00
parent 35456c3032
commit 0d3d176d3b
Signed by: derped
SSH key fingerprint: SHA256:8/FSu/lmp3c1Z17Gml06JRIEHtDjhwdd7g6pBaHQWBc

View file

@ -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
'';
}