plugins/treesitter: support unsetting keymaps

This commit is contained in:
Austin Horstman 2024-07-24 19:55:49 -05:00
parent c12e59ff7c
commit 91130385ed
No known key found for this signature in database
2 changed files with 20 additions and 2 deletions

View file

@ -118,7 +118,11 @@ helpers.neovim-plugin.mkNeovimPlugin config {
keymaps = keymaps =
let let
mkKeymap = default: helpers.defaultNullOpts.mkStr default "Key shortcut"; mkKeymap =
default:
helpers.defaultNullOpts.mkNullableWithRaw (
with types; either str bool
) default "Key shortcut or false to unset.";
in in
{ {
init_selection = mkKeymap "gnn"; init_selection = mkKeymap "gnn";
@ -190,7 +194,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
enable = true; enable = true;
keymaps = { keymaps = {
init_selection = "gnn"; init_selection = false;
node_decremental = "grm"; node_decremental = "grm";
node_incremental = "grn"; node_incremental = "grn";
scope_incremental = "grc"; scope_incremental = "grc";

View file

@ -120,4 +120,18 @@
]; ];
}; };
}; };
disable-init-selection = {
plugins.treesitter = {
enable = true;
settings = {
incremental_selection = {
enable = true;
keymaps.init_selection = false;
};
};
};
};
} }