2024-11-19 17:01:19 +00:00
|
|
|
lib: rec {
|
2024-08-24 01:55:49 +01:00
|
|
|
# FIXME: don't manually put Default in the description
|
|
|
|
# TODO: Comply with #603
|
2024-03-24 17:42:40 +01:00
|
|
|
mkModeMappingsOption =
|
|
|
|
mode: defaults:
|
2024-08-24 01:55:49 +01:00
|
|
|
lib.mkOption {
|
|
|
|
type = with lib.types; attrsOf strLuaFn;
|
2024-03-24 17:42:40 +01:00
|
|
|
default = { };
|
|
|
|
description = ''
|
|
|
|
Keymaps in ${mode} mode.
|
|
|
|
|
|
|
|
Default:
|
|
|
|
```nix
|
|
|
|
${defaults}
|
|
|
|
```
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
mkMappingsOption =
|
|
|
|
{ insertDefaults, normalDefaults }:
|
|
|
|
{
|
|
|
|
i = mkModeMappingsOption "insert" insertDefaults;
|
|
|
|
n = mkModeMappingsOption "normal" normalDefaults;
|
|
|
|
};
|
|
|
|
}
|