mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
plugins/utils: move to by-name
This commit is contained in:
parent
faff32b9f1
commit
52f125679f
195 changed files with 2 additions and 102 deletions
46
plugins/by-name/quickmath/default.nix
Normal file
46
plugins/by-name/quickmath/default.nix
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
lib,
|
||||
helpers,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
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"
|
||||
];
|
||||
};
|
||||
|
||||
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;
|
||||
action = ":Quickmath<CR>";
|
||||
options.silent = cfg.keymap.silent;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue