mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 16:39:00 +02:00
plugins/vim-bbye: migrate to mkVimPlugin
This commit is contained in:
parent
a24ec7412e
commit
471f68d9bb
2 changed files with 15 additions and 27 deletions
|
@ -84,7 +84,6 @@ KNOWN_PATHS: dict[
|
||||||
Kind.NEOVIM,
|
Kind.NEOVIM,
|
||||||
True,
|
True,
|
||||||
),
|
),
|
||||||
"plugins/by-name/vim-bbye/default.nix": (State.OLD, Kind.VIM, False), # No options
|
|
||||||
"plugins/by-name/vim-matchup/default.nix": (State.OLD, Kind.VIM, False),
|
"plugins/by-name/vim-matchup/default.nix": (State.OLD, Kind.VIM, False),
|
||||||
"plugins/colorschemes/base16/default.nix": (State.NEW, Kind.VIM, True),
|
"plugins/colorschemes/base16/default.nix": (State.NEW, Kind.VIM, True),
|
||||||
"plugins/lsp/default.nix": (State.NEW, Kind.MISC, False),
|
"plugins/lsp/default.nix": (State.NEW, Kind.MISC, False),
|
||||||
|
|
|
@ -1,59 +1,48 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
helpers,
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
cfg = config.plugins.vim-bbye;
|
inherit (lib.nixvim) mkNullOrOption;
|
||||||
|
inherit (lib) types;
|
||||||
in
|
in
|
||||||
{
|
lib.nixvim.vim-plugin.mkVimPlugin {
|
||||||
options.plugins.vim-bbye = {
|
name = "vim-bbye";
|
||||||
enable = mkEnableOption "vim-bbye";
|
|
||||||
|
|
||||||
package = lib.mkPackageOption pkgs "vim-bbye" {
|
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||||
default = [
|
|
||||||
"vimPlugins"
|
|
||||||
"vim-bbye"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
keymapsSilent = mkOption {
|
extraOptions = {
|
||||||
|
keymapsSilent = lib.mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
description = "Whether vim-bbye keymaps should be silent.";
|
description = "Whether vim-bbye keymaps should be silent.";
|
||||||
default = false;
|
default = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
keymaps = {
|
keymaps = {
|
||||||
bdelete = helpers.mkNullOrOption types.str ''
|
bdelete = mkNullOrOption types.str ''
|
||||||
Keymap for deleting the current buffer.";
|
Keymap for deleting the current buffer.";
|
||||||
'';
|
'';
|
||||||
|
|
||||||
bwipeout = helpers.mkNullOrOption types.str ''
|
bwipeout = mkNullOrOption types.str ''
|
||||||
Keymap for completely deleting the current buffer.";
|
Keymap for completely deleting the current buffer.";
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
extraConfig = cfg: {
|
||||||
extraPlugins = [ cfg.package ];
|
|
||||||
|
|
||||||
keymaps =
|
keymaps =
|
||||||
with cfg.keymaps;
|
lib.nixvim.keymaps.mkKeymaps
|
||||||
helpers.keymaps.mkKeymaps
|
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
options.silent = cfg.keymapsSilent;
|
options.silent = cfg.keymapsSilent;
|
||||||
}
|
}
|
||||||
(
|
(
|
||||||
(optional (bdelete != null) {
|
(lib.optional (cfg.keymaps.bdelete != null) {
|
||||||
key = bdelete;
|
key = cfg.keymaps.bdelete;
|
||||||
action = ":Bdelete<CR>";
|
action = ":Bdelete<CR>";
|
||||||
})
|
})
|
||||||
++ (optional (bwipeout != null) {
|
++ (lib.optional (cfg.keymaps.bwipeout != null) {
|
||||||
key = bwipeout;
|
key = cfg.keymaps.bwipeout;
|
||||||
action = ":Bwipeout<CR>";
|
action = ":Bwipeout<CR>";
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue