Skip to content

Commit

Permalink
lz.n: add missing PluginSpec options
Browse files Browse the repository at this point in the history
  • Loading branch information
horriblename committed Aug 18, 2024
1 parent 2c561bb commit 8b3e078
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions lib/types/plugins.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
inherit (lib.options) mkOption;
inherit (lib.attrsets) attrNames mapAttrs' filterAttrs nameValuePair;
inherit (lib.strings) hasPrefix removePrefix;
inherit (lib.types) submodule either package enum str lines attrsOf anything listOf nullOr oneOf bool;
inherit (lib.types) submodule either package enum str lines attrsOf anything listOf nullOr oneOf bool int;
# Get the names of all flake inputs that start with the given prefix.
fromInputs = {
inputs,
Expand Down Expand Up @@ -138,6 +138,18 @@

# lz.n options

enabled = mkOption {
type = nullOr (either bool str);
description = "When false, or if the lua function returns false, this plugin will not be included in the spec";
default = null;
};

beforeAll = mkOption {
type = nullOr str;
description = "Lua code to run before any plugins are loaded. This will be wrapped in a function.";
default = null;
};

before = mkOption {
type = nullOr str;
description = "Lua code to run before plugin is loaded. This will be wrapped in a function.";
Expand Down Expand Up @@ -195,7 +207,27 @@
'';
};

# TODO: enabled, beforeAll, colorscheme, priority, load
colorscheme = mkOption {
description = "Lazy-load on colorscheme.";
type = nullOr (either str (listOf str));
default = null;
};

priority = mkOption {
type = nullOr int;
description = "Only useful for stat plugins (not lazy-loaded) to force loading certain plugins first.";
default = null;
};

load = mkOption {
type = nullOr str;
default = null;
description = ''
Lua code to override the `vim.g.lz_n.load()` function for a single plugin.
This will be wrapped in a function
'';
};
};
};
in {
Expand Down

0 comments on commit 8b3e078

Please sign in to comment.