2023-07-01 08:57:44 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
let
|
2024-12-15 22:23:03 +01:00
|
|
|
inherit (lib) types;
|
2023-07-01 08:57:44 +02:00
|
|
|
in
|
2024-12-15 22:23:03 +01:00
|
|
|
lib.nixvim.vim-plugin.mkVimPlugin {
|
|
|
|
name = "quickmath";
|
|
|
|
packPathName = "quickmath.nvim";
|
|
|
|
package = "quickmath-nvim";
|
2023-07-01 08:57:44 +02:00
|
|
|
|
2024-12-15 22:23:03 +01:00
|
|
|
maintainers = [ lib.maintainers.GaetanLepage ];
|
2023-07-01 08:57:44 +02:00
|
|
|
|
2024-12-15 22:23:03 +01:00
|
|
|
extraOptions = {
|
2023-07-01 08:57:44 +02:00
|
|
|
keymap = {
|
2024-12-15 22:23:03 +01:00
|
|
|
key = lib.nixvim.mkNullOrOption types.str "Keymap to run the `:Quickmath` command.";
|
2023-07-01 08:57:44 +02:00
|
|
|
|
2024-12-15 22:23:03 +01:00
|
|
|
silent = lib.mkOption {
|
2023-07-01 08:57:44 +02:00
|
|
|
type = types.bool;
|
|
|
|
description = "Whether the quickmath keymap should be silent.";
|
|
|
|
default = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-12-15 22:23:03 +01:00
|
|
|
extraConfig = cfg: {
|
2023-09-15 14:35:13 +02:00
|
|
|
keymaps =
|
|
|
|
with cfg.keymap;
|
2024-12-15 22:23:03 +01:00
|
|
|
lib.optional (key != null) {
|
2023-09-15 14:35:13 +02:00
|
|
|
mode = "n";
|
|
|
|
inherit key;
|
2024-12-15 22:23:03 +01:00
|
|
|
action = "<CMD>Quickmath<CR>";
|
2023-09-15 14:35:13 +02:00
|
|
|
options.silent = cfg.keymap.silent;
|
2023-07-01 08:57:44 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|