plugins/misc: adapt to new maps options

This commit is contained in:
Gaetan Lepage 2023-09-15 14:35:13 +02:00 committed by Gaétan Lepage
parent 574fb73258
commit dd6a114e52
18 changed files with 262 additions and 193 deletions

View file

@ -93,19 +93,19 @@ in
// cfg.extraConfig
);
maps.normal = mkMerge (
keymaps = flatten (
mapAttrsToList
(
name: value: let
key = cfg.keymaps.${name};
in
if key == null
then {}
else {
${key} = {
action = ":JuliaCell${value.cmd}<CR>";
inherit (cfg.keymaps) silent;
};
optional
(key != null)
{
mode = "n";
inherit key;
action = ":JuliaCell${value.cmd}<CR>";
options.silent = cfg.keymaps.silent;
}
)
mappings

View file

@ -34,9 +34,20 @@ in {
# Add the typst compiler to nixvim packages
extraPackages = with pkgs; [typst];
maps.normal = with cfg.keymaps;
helpers.mkModeMaps {inherit silent;} {
${watch} = ":TypstWatch<CR>";
};
keymaps = with cfg.keymaps;
helpers.mkKeymaps
{
mode = "n";
options.silent = silent;
}
(
optional
(watch != null)
{
# mode = "n";
key = watch;
action = ":TypstWatch<CR>";
}
);
};
}