2023-07-01 08:57:44 +02:00
|
|
|
{
|
|
|
|
lib,
|
2023-11-06 15:04:08 +01:00
|
|
|
helpers,
|
|
|
|
config,
|
|
|
|
pkgs,
|
2023-07-01 08:57:44 +02:00
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.plugins.quickmath;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.plugins.quickmath = {
|
|
|
|
enable = mkEnableOption "quickmath.nvim";
|
|
|
|
|
2024-05-17 14:09:20 +02:00
|
|
|
package = helpers.mkPluginPackageOption "quickmath.nvim" pkgs.vimPlugins.quickmath-nvim;
|
2023-07-01 08:57:44 +02:00
|
|
|
|
|
|
|
keymap = {
|
|
|
|
key = helpers.mkNullOrOption types.str "Keymap to run the `:Quickmath` command.";
|
|
|
|
|
|
|
|
silent = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
description = "Whether the quickmath keymap should be silent.";
|
|
|
|
default = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
extraPlugins = [ cfg.package ];
|
|
|
|
|
2023-09-15 14:35:13 +02:00
|
|
|
keymaps =
|
|
|
|
with cfg.keymap;
|
|
|
|
optional (key != null) {
|
|
|
|
mode = "n";
|
|
|
|
inherit key;
|
2023-07-01 08:57:44 +02:00
|
|
|
action = ":Quickmath<CR>";
|
2023-09-15 14:35:13 +02:00
|
|
|
options.silent = cfg.keymap.silent;
|
2023-07-01 08:57:44 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|