mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-23 05:40:44 +00:00
lib: add lz.n KeySpec
This commit is contained in:
parent
4014ab0a01
commit
d660aae9be
1 changed files with 60 additions and 2 deletions
|
@ -6,7 +6,7 @@
|
|||
inherit (lib.options) mkOption;
|
||||
inherit (lib.attrsets) attrNames mapAttrs' filterAttrs nameValuePair;
|
||||
inherit (lib.strings) hasPrefix removePrefix;
|
||||
inherit (lib.types) submodule either package enum str lines attrsOf anything listOf nullOr oneOf;
|
||||
inherit (lib.types) submodule either package enum str lines attrsOf anything listOf nullOr oneOf bool;
|
||||
# Get the names of all flake inputs that start with the given prefix.
|
||||
fromInputs = {
|
||||
inputs,
|
||||
|
@ -56,6 +56,64 @@
|
|||
check = x: lib.nvim.lua.isLuaInline x;
|
||||
};
|
||||
|
||||
lznKeysSpec = submodule {
|
||||
apply = x:
|
||||
x
|
||||
// {
|
||||
"@1" = x.lhs;
|
||||
"@2" = x.rhs;
|
||||
};
|
||||
|
||||
options = {
|
||||
desc = mkOption {
|
||||
description = "Description of the key map";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
|
||||
noremap = mkOption {
|
||||
description = "TBD";
|
||||
type = bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
expr = mkOption {
|
||||
description = "TBD";
|
||||
type = bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
nowait = mkOption {
|
||||
description = "TBD";
|
||||
type = bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
ft = mkOption {
|
||||
description = "TBD";
|
||||
type = nullOr (listOf str);
|
||||
default = null;
|
||||
};
|
||||
|
||||
lhs = mkOption {
|
||||
type = str;
|
||||
description = "Key to bind to";
|
||||
};
|
||||
|
||||
rhs = mkOption {
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
description = "Action to trigger";
|
||||
};
|
||||
|
||||
mode = mkOption {
|
||||
description = "Modes to bind in";
|
||||
type = listOf str;
|
||||
default = ["n"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
lznPluginTableType = attrsOf lznPluginType;
|
||||
lznPluginType = submodule {
|
||||
options = {
|
||||
|
@ -135,7 +193,7 @@
|
|||
keys = mkOption {
|
||||
description = "Lazy-load on key mapping";
|
||||
default = null;
|
||||
type = nullOr (either str (listOf str)); # TODO: support lz.n.KeysSpec
|
||||
type = nullOr (oneOf [str (listOf str) lznKeysSpec]); # TODO: support lz.n.KeysSpec
|
||||
};
|
||||
|
||||
# TODO: enabled, beforeAll, colorscheme, priority, load
|
||||
|
|
Loading…
Reference in a new issue