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
61
plugins/by-name/vim-bbye/default.nix
Normal file
61
plugins/by-name/vim-bbye/default.nix
Normal file
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
lib,
|
||||
helpers,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.plugins.vim-bbye;
|
||||
in
|
||||
{
|
||||
options.plugins.vim-bbye = {
|
||||
enable = mkEnableOption "vim-bbye";
|
||||
|
||||
package = lib.mkPackageOption pkgs "vim-bbye" {
|
||||
default = [
|
||||
"vimPlugins"
|
||||
"vim-bbye"
|
||||
];
|
||||
};
|
||||
|
||||
keymapsSilent = mkOption {
|
||||
type = types.bool;
|
||||
description = "Whether vim-bbye keymaps should be silent.";
|
||||
default = false;
|
||||
};
|
||||
|
||||
keymaps = {
|
||||
bdelete = helpers.mkNullOrOption types.str ''
|
||||
Keymap for deleting the current buffer.";
|
||||
'';
|
||||
|
||||
bwipeout = helpers.mkNullOrOption types.str ''
|
||||
Keymap for completely deleting the current buffer.";
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
extraPlugins = [ cfg.package ];
|
||||
|
||||
keymaps =
|
||||
with cfg.keymaps;
|
||||
helpers.keymaps.mkKeymaps
|
||||
{
|
||||
mode = "n";
|
||||
options.silent = cfg.keymapsSilent;
|
||||
}
|
||||
(
|
||||
(optional (bdelete != null) {
|
||||
key = bdelete;
|
||||
action = ":Bdelete<CR>";
|
||||
})
|
||||
++ (optional (bwipeout != null) {
|
||||
key = bwipeout;
|
||||
action = ":Bwipeout<CR>";
|
||||
})
|
||||
);
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue