mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 21:30:51 +00:00
lazy: use similar API to nvf keymaps
This commit is contained in:
parent
05156b4e1b
commit
945b9e6500
2 changed files with 18 additions and 9 deletions
|
@ -88,16 +88,21 @@
|
||||||
default = null;
|
default = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
lhs = mkOption {
|
key = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
description = "Key to bind to";
|
description = "Key to bind to";
|
||||||
};
|
};
|
||||||
|
|
||||||
rhs = mkOption {
|
action = mkOption {
|
||||||
type = nullOr (either str luaInline);
|
type = nullOr str;
|
||||||
default = null;
|
default = null;
|
||||||
# FIXME: use a separate flag to indicate lua instead of luaInline
|
description = "Action to trigger.";
|
||||||
description = "Action to trigger. luaInline code will be wrapped in a function.";
|
};
|
||||||
|
|
||||||
|
lua = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = false;
|
||||||
|
description = "If true the action is treated as a lua function instead of a vim command.";
|
||||||
};
|
};
|
||||||
|
|
||||||
mode = mkOption {
|
mode = mkOption {
|
||||||
|
|
|
@ -18,12 +18,16 @@
|
||||||
expr,
|
expr,
|
||||||
nowait,
|
nowait,
|
||||||
ft,
|
ft,
|
||||||
lhs,
|
key,
|
||||||
rhs,
|
action,
|
||||||
|
lua,
|
||||||
mode,
|
mode,
|
||||||
}: {
|
}: {
|
||||||
"@1" = lhs;
|
"@1" = key;
|
||||||
"@2" = rhs;
|
"@2" =
|
||||||
|
if lua
|
||||||
|
then mkLuaInline action
|
||||||
|
else action;
|
||||||
inherit desc noremap expr nowait ft mode;
|
inherit desc noremap expr nowait ft mode;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue