nvim: move treesitter config into opts
This commit is contained in:
parent
35456c3032
commit
0d3d176d3b
1 changed files with 21 additions and 20 deletions
|
@ -17,35 +17,36 @@ lib.mkIf (lib.elem "nvim::treesitter" config.machine.pkgs) {
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
lazy = false;
|
lazy = false;
|
||||||
dir = treesitter;
|
dir = _: treesitter;
|
||||||
event = [
|
event = [
|
||||||
"BufReadPost"
|
"BufReadPost"
|
||||||
"BufWritePost"
|
"BufWritePost"
|
||||||
"BufNewFile"
|
"BufNewFile"
|
||||||
"VeryLazy"
|
"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
|
config = # lua
|
||||||
''
|
''
|
||||||
function()
|
function(_, opts)
|
||||||
vim.opt.rtp:prepend("${grammars}")
|
vim.opt.rtp:prepend("${grammars}")
|
||||||
require("nvim-treesitter.configs").setup({
|
require("nvim-treesitter.configs").setup(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
|
|
||||||
}
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue