mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-13 02:34:34 +02:00
plugins/quickmath: init + test
This commit is contained in:
parent
341eb9d094
commit
269d592ea8
3 changed files with 54 additions and 0 deletions
37
plugins/utils/quickmath.nix
Normal file
37
plugins/utils/quickmath.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.plugins.quickmath;
|
||||
helpers = import ../helpers.nix {inherit lib;};
|
||||
in {
|
||||
options.plugins.quickmath = {
|
||||
enable = mkEnableOption "quickmath.nvim";
|
||||
|
||||
package = helpers.mkPackageOption "quickmath.nvim" pkgs.vimPlugins.quickmath-nvim;
|
||||
|
||||
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];
|
||||
|
||||
maps.normal = mkIf (cfg.keymap.key != null) {
|
||||
${cfg.keymap.key} = {
|
||||
action = ":Quickmath<CR>";
|
||||
inherit (cfg.keymap) silent;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue