nix-community.nixvim/plugins/by-name/quickmath/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
864 B
Nix
Raw Permalink Normal View History

2023-07-01 08:57:44 +02:00
{
lib,
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";
package = lib.mkPackageOption pkgs "quickmath.nvim" {
default = [
"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 ];
keymaps =
with cfg.keymap;
optional (key != null) {
mode = "n";
inherit key;
2023-07-01 08:57:44 +02:00
action = ":Quickmath<CR>";
options.silent = cfg.keymap.silent;
2023-07-01 08:57:44 +02:00
};
};
}