mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
modules/keymaps: add replace_keycodes keymap sub-option
This commit is contained in:
parent
fe95b14d52
commit
95573411bc
2 changed files with 13 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
||||||
{ lib }:
|
{ lib }:
|
||||||
let
|
let
|
||||||
inherit (lib) optionalAttrs isAttrs types;
|
inherit (lib) optionalAttrs isAttrs types;
|
||||||
inherit (lib.nixvim) defaultNullOpts mkNullOrStr;
|
inherit (lib.nixvim) defaultNullOpts mkNullOrOption mkNullOrStr;
|
||||||
in
|
in
|
||||||
rec {
|
rec {
|
||||||
# These are the configuration options that change the behavior of each mapping.
|
# These are the configuration options that change the behavior of each mapping.
|
||||||
|
@ -23,6 +23,12 @@ rec {
|
||||||
desc = mkNullOrStr "A textual description of this keybind, to be shown in which-key, if you have it.";
|
desc = mkNullOrStr "A textual description of this keybind, to be shown in which-key, if you have it.";
|
||||||
|
|
||||||
buffer = defaultNullOpts.mkBool false "Make the mapping buffer-local. Equivalent to adding `<buffer>` to a map.";
|
buffer = defaultNullOpts.mkBool false "Make the mapping buffer-local. Equivalent to adding `<buffer>` to a map.";
|
||||||
|
|
||||||
|
replace_keycodes = mkNullOrOption types.bool ''
|
||||||
|
When `expr` is `true`, replace keycodes in the resulting string.
|
||||||
|
|
||||||
|
Returning `nil` from the Lua `callback` is equivalent to returning an empty string.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
modes = [
|
modes = [
|
||||||
|
|
|
@ -48,6 +48,12 @@
|
||||||
key = "<C-z>";
|
key = "<C-z>";
|
||||||
action = "bar";
|
action = "bar";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<C-h>";
|
||||||
|
action.__raw = "function() end";
|
||||||
|
options.replace_keycodes = false;
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue