mappings: deprecate vim.maps

This commit is contained in:
Ching Pei Yang 2026-06-12 14:01:12 +02:00 committed by Ching Pei Yang
commit caef79e398

View file

@ -1,13 +1,14 @@
{
options,
config,
lib,
...
}: let
inherit (lib.modules) mkMerge;
inherit (lib.options) mkOption literalMD;
inherit (lib.options) mkOption literalMD showFiles;
inherit (lib.types) either str listOf attrsOf nullOr submodule;
inherit (lib.attrsets) mapAttrsToList;
inherit (lib.lists) flatten;
inherit (lib.lists) flatten optional;
inherit (lib.trivial) pipe;
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.config) mkBool;
@ -63,10 +64,10 @@
legacyMapOption = mode:
mkOption {
description = "Mappings for ${mode} mode";
visible = false;
type = attrsOf (submodule {
options = mapConfigOptions;
});
default = {};
};
legacyMapModes = {
@ -152,5 +153,14 @@ in {
]
)
];
# 2026-06-12
warnings = mkMerge (mapAttrsToList (
name: option:
optional
option.isDefined
"The option `vim.maps.${name}` defined in ${showFiles option.files} is deprecated, please use `vim.keymaps` instead. "
)
options.vim.maps);
};
}