nix-community.nixvim/plugins/by-name/vim-bbye/default.nix
osbm a41559f093
Some checks are pending
Publish every Git push to main to FlakeHub / flakehub-publish (push) Waiting to run
Publish every git push to Flakestry / publish-flake (push) Waiting to run
Documentation / Version info (push) Waiting to run
Documentation / Build (push) Blocked by required conditions
Documentation / Combine builds (push) Blocked by required conditions
Documentation / Deploy (push) Blocked by required conditions
treewide: add plugin descriptions
2025-06-24 06:10:11 +00:00

51 lines
1.2 KiB
Nix

{
lib,
...
}:
let
inherit (lib.nixvim) mkNullOrOption;
inherit (lib) types;
in
lib.nixvim.plugins.mkVimPlugin {
name = "vim-bbye";
description = "Delete buffers and close files in Vim without closing your windows or messing up your layout.";
maintainers = [ lib.maintainers.GaetanLepage ];
extraOptions = {
keymapsSilent = lib.mkOption {
type = types.bool;
description = "Whether vim-bbye keymaps should be silent.";
default = false;
};
keymaps = {
bdelete = mkNullOrOption types.str ''
Keymap for deleting the current buffer.";
'';
bwipeout = mkNullOrOption types.str ''
Keymap for completely deleting the current buffer.";
'';
};
};
extraConfig = cfg: {
keymaps =
lib.nixvim.keymaps.mkKeymaps
{
mode = "n";
options.silent = cfg.keymapsSilent;
}
(
(lib.optional (cfg.keymaps.bdelete != null) {
key = cfg.keymaps.bdelete;
action = ":Bdelete<CR>";
})
++ (lib.optional (cfg.keymaps.bwipeout != null) {
key = cfg.keymaps.bwipeout;
action = ":Bwipeout<CR>";
})
);
};
}