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;
|
||||
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
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue