mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
modules/keymaps: bind lua function calls (#178)
This commit is contained in:
parent
b1bd19b1b5
commit
a15c0543a4
2 changed files with 18 additions and 5 deletions
|
@ -55,7 +55,13 @@ with lib; rec {
|
|||
nowait = false;
|
||||
action = action;
|
||||
}
|
||||
else action)
|
||||
else {
|
||||
inherit (action) silent expr unique noremap script nowait;
|
||||
action =
|
||||
if action.lua
|
||||
then mkRaw action.action
|
||||
else action;
|
||||
})
|
||||
maps;
|
||||
in
|
||||
builtins.attrValues (builtins.mapAttrs
|
||||
|
|
|
@ -51,11 +51,18 @@ with lib; let
|
|||
description = "The action to execute.";
|
||||
};
|
||||
|
||||
description = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "A textual description of this keybind, to be shown in which-key, if you have it.";
|
||||
default = null;
|
||||
lua = mkOption {
|
||||
type = types.bool;
|
||||
description = ''
|
||||
If true, `action` is considered to be lua code.
|
||||
Thus, it will not be wrapped in `""`.
|
||||
'';
|
||||
default = false;
|
||||
};
|
||||
|
||||
description = helpers.mkNullOrOption types.str ''
|
||||
A textual description of this keybind, to be shown in which-key, if you have it.
|
||||
'';
|
||||
};
|
||||
})
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue