Define keyBind interface in submodule.
This commit is contained in:
parent
751da80178
commit
ac43fae727
1 changed files with 30 additions and 3 deletions
|
@ -2,7 +2,34 @@
|
|||
let
|
||||
mkOption = lib.mkOption;
|
||||
types = lib.types;
|
||||
plugin = types.submodule (
|
||||
keyBind = (
|
||||
{ ... }:
|
||||
{
|
||||
options = {
|
||||
bind = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
description = ''The keys to bind.'';
|
||||
};
|
||||
cmd = mkOption {
|
||||
type = with types; nullOr str;
|
||||
default = null;
|
||||
description = ''The command to execute. If this is a lua function set cmdIsFunction to true.'';
|
||||
};
|
||||
cmdIsFunction = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''Needs to be set to true if cmd is a lua function.'';
|
||||
};
|
||||
opts = mkOption {
|
||||
type = with types; nullOr attrs;
|
||||
default = null;
|
||||
description = ''Additional named parameters passed to the keybind function.'';
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
plugin = (
|
||||
{ ... }:
|
||||
{
|
||||
options = {
|
||||
|
@ -150,7 +177,7 @@ let
|
|||
};
|
||||
keys = mkOption {
|
||||
# TODO: update;
|
||||
type = with types; nullOr (listOf attrs);
|
||||
type = with types; nullOr (listOf (submodule keyBind));
|
||||
default = null;
|
||||
description = ''Lazy-load on key mapping.'';
|
||||
};
|
||||
|
@ -195,7 +222,7 @@ in
|
|||
with types;
|
||||
listOf (oneOf [
|
||||
str
|
||||
plugin
|
||||
(submodule plugin)
|
||||
]);
|
||||
default = [ ];
|
||||
description = ''List of plugins to be installed with neovim.'';
|
||||
|
|
Loading…
Reference in a new issue