helpers/vim-plugin/mkVimPlugin: refactor

This commit is contained in:
Gaetan Lepage 2024-02-09 14:21:22 +01:00 committed by Gaétan Lepage
parent 66c069c48d
commit 3c174e874c
20 changed files with 739 additions and 744 deletions

View file

@ -3,11 +3,7 @@
nixvimOptions,
}:
with lib; {
mkVimPlugin = {
config,
lib,
...
}: {
mkVimPlugin = config: {
name,
description ? null,
package ? null,

View file

@ -1,11 +1,13 @@
{
lib,
config,
helpers,
pkgs,
...
} @ args:
with lib; (
with (import ../helpers.nix {inherit lib;}).vim-plugin;
mkVimPlugin args {
}:
with lib;
with helpers.vim-plugin;
helpers.vim-plugin.mkVimPlugin config {
name = "copilot-vim";
description = "copilot.vim";
package = pkgs.vimPlugins.copilot-vim;
@ -39,4 +41,3 @@ with lib; (
};
};
}
)

View file

@ -14,7 +14,7 @@ in
useDefaultPackage ? true,
...
}:
mkVimPlugin {inherit lib config pkgs;} {
mkVimPlugin config {
inherit name;
extraPlugins = extraPlugins ++ (lists.optional useDefaultPackage pkgs.vimPlugins.${name});
};

View file

@ -1,13 +1,10 @@
{
lib,
config,
helpers,
pkgs,
...
} @ attrs: let
helpers = import ../helpers.nix {inherit lib;};
in
with helpers.vim-plugin;
with lib;
mkVimPlugin attrs {
}:
helpers.vim-plugin.mkVimPlugin config {
name = "fugitive";
description = "vim-fugitive";
package = pkgs.vimPlugins.vim-fugitive;
@ -15,4 +12,4 @@ in
# In typical tpope fashion, this plugin has no config options
options = {};
}
}

View file

@ -1,11 +1,13 @@
{
lib,
config,
helpers,
pkgs,
...
} @ args:
}:
with lib;
with (import ../helpers.nix {inherit lib;}).vim-plugin;
mkVimPlugin args {
with helpers.vim-plugin;
mkVimPlugin config {
name = "ledger";
description = "ledger language features";
package = pkgs.vimPlugins.vim-ledger;

View file

@ -1,12 +1,13 @@
{
lib,
pkgs,
config,
helpers,
pkgs,
...
} @ args:
}:
with lib;
with (import ../helpers.nix {inherit lib;}).vim-plugin;
mkVimPlugin args {
with helpers.vim-plugin;
mkVimPlugin config {
name = "markdown-preview";
description = "markdown-preview.nvim";
package = pkgs.vimPlugins.markdown-preview-nvim;

View file

@ -1,17 +1,14 @@
{
lib,
config,
helpers,
pkgs,
...
} @ attrs: let
helpers = import ../helpers.nix {inherit lib;};
in
with helpers.vim-plugin;
with lib;
mkVimPlugin attrs {
}:
helpers.vim-plugin.mkVimPlugin config {
name = "nix";
description = "vim-nix";
package = pkgs.vimPlugins.vim-nix;
# Possibly add option to disable Treesitter highlighting if this is installed
options = {};
}
}

View file

@ -1,13 +1,12 @@
{
lib,
helpers,
config,
pkgs,
...
} @ args:
with lib;
with (import ../helpers.nix {inherit lib;}).vim-plugin;
mkVimPlugin args {
}:
helpers.vim-plugin.mkVimPlugin config {
name = "tagbar";
package = pkgs.vimPlugins.tagbar;
globalPrefix = "tagbar_";
extraPackages = [pkgs.ctags];
}
}

View file

@ -1,13 +1,13 @@
{
lib,
config,
helpers,
pkgs,
...
} @ args: let
helpers = import ../helpers.nix {inherit lib;};
in
with lib;
with helpers.vim-plugin;
mkVimPlugin args {
}:
with lib;
with helpers.vim-plugin;
mkVimPlugin config {
name = "vim-slime";
package = pkgs.vimPlugins.vim-slime;
globalPrefix = "slime_";

View file

@ -1,13 +1,13 @@
{
lib,
config,
helpers,
pkgs,
...
} @ attrs: let
helpers = import ../helpers.nix {inherit lib;};
in
with helpers.vim-plugin;
with lib;
mkVimPlugin attrs {
}:
with lib;
with helpers.vim-plugin;
mkVimPlugin config {
name = "zig";
description = "zig.vim";
package = pkgs.vimPlugins.zig-vim;

View file

@ -1,11 +1,13 @@
{
lib,
config,
helpers,
pkgs,
...
} @ args:
}:
with lib;
with (import ../helpers.nix {inherit lib;}).vim-plugin;
mkVimPlugin args {
with helpers.vim-plugin;
mkVimPlugin config {
name = "airline";
description = "vim-airline";
package = pkgs.vimPlugins.vim-airline;

View file

@ -1,13 +1,13 @@
{
lib,
config,
helpers,
pkgs,
...
} @ attrs:
with lib; let
helpers = import ../helpers.nix {inherit lib;};
in
with helpers.vim-plugin;
mkVimPlugin attrs {
}:
with lib;
with helpers.vim-plugin;
mkVimPlugin config {
name = "emmet";
package = pkgs.vimPlugins.emmet-vim;
globalPrefix = "user_emmet_";

View file

@ -1,17 +1,14 @@
{
lib,
config,
pkgs,
helpers,
...
} @ attrs: let
helpers = import ../helpers.nix {inherit lib;};
in
with helpers.vim-plugin;
with lib;
mkVimPlugin attrs {
}:
helpers.vim-plugin.mkVimPlugin config {
name = "endwise";
description = "vim-endwise";
package = pkgs.vimPlugins.vim-endwise;
# Yes it's really not configurable
options = {};
}
}

View file

@ -1,13 +1,13 @@
{
lib,
config,
helpers,
pkgs,
...
} @ attrs: let
helpers = import ../helpers.nix {inherit lib;};
in
with helpers.vim-plugin;
with lib;
mkVimPlugin attrs {
}:
with helpers.vim-plugin;
with lib;
mkVimPlugin config {
name = "goyo";
description = "goyo.vim";
package = pkgs.vimPlugins.goyo-vim;

View file

@ -1,11 +1,13 @@
{
lib,
config,
helpers,
pkgs,
...
} @ args:
}:
with lib;
with (import ../helpers.nix {inherit lib;}).vim-plugin;
mkVimPlugin args {
with helpers.vim-plugin;
mkVimPlugin config {
name = "instant";
description = "instant.nvim";
package = pkgs.vimPlugins.instant-nvim;

View file

@ -1,11 +1,13 @@
{
lib,
config,
helpers,
pkgs,
...
} @ args:
}:
with lib;
with (import ../helpers.nix {inherit lib;}).vim-plugin;
mkVimPlugin args {
with helpers.vim-plugin;
mkVimPlugin config {
name = "magma-nvim";
description = "magma-nvim";
package = pkgs.vimPlugins.magma-nvim-goose;

View file

@ -1,13 +1,13 @@
{
lib,
config,
helpers,
pkgs,
...
} @ args: let
helpers = import ../helpers.nix {inherit lib;};
in
with lib;
with helpers.vim-plugin;
mkVimPlugin args {
}:
with lib;
with helpers.vim-plugin;
mkVimPlugin config {
name = "molten";
description = "molten-nvim";
package = pkgs.vimPlugins.molten-nvim;

View file

@ -1,13 +1,13 @@
{
lib,
config,
helpers,
pkgs,
...
} @ args: let
helpers = import ../helpers.nix {inherit lib;};
in
with lib;
with helpers.vim-plugin;
mkVimPlugin args {
}:
with lib;
with helpers.vim-plugin;
mkVimPlugin config {
name = "startify";
package = pkgs.vimPlugins.vim-startify;
globalPrefix = "startify_";

View file

@ -1,16 +1,13 @@
{
lib,
config,
helpers,
pkgs,
...
} @ attrs: let
helpers = import ../helpers.nix {inherit lib;};
in
with helpers.vim-plugin;
with lib;
mkVimPlugin attrs {
}:
helpers.vim-plugin.mkVimPlugin config {
name = "surround";
description = "surround.vim";
package = pkgs.vimPlugins.surround;
options = {};
}
}

View file

@ -1,11 +1,13 @@
{
lib,
config,
helpers,
pkgs,
...
} @ args:
}:
with lib;
with (import ../helpers.nix {inherit lib;}).vim-plugin;
mkVimPlugin args {
with helpers.vim-plugin;
mkVimPlugin config {
name = "undotree";
package = pkgs.vimPlugins.undotree;
globalPrefix = "undotree_";