Compare commits

..

38 commits

Author SHA1 Message Date
Ching Pei Yang
961ebc2b08
Merge 83fd1b5c7a into e40cce5653 2024-08-17 11:19:41 +00:00
Ching Pei Yang
83fd1b5c7a lz.n: add missing PluginSpec options 2024-08-17 13:19:12 +02:00
Ching Pei Yang
e40cce5653
fix: map descriptions (#358)
* remove unused

* maps: fix missing description
2024-08-17 13:08:47 +02:00
Ching Pei Yang
c331e3303e add TODO 2024-08-17 13:03:54 +02:00
Ching Pei Yang
745d539732 lib: allow luaInline in lz.n map action 2024-08-17 13:03:54 +02:00
Ching Pei Yang
4dcce23410 flake: update lzn-auto-require 2024-08-17 13:03:54 +02:00
Ching Pei Yang
29f9e3f168 fixup! wrapper: use lzn-auto-require loader 2024-08-17 13:03:54 +02:00
Ching Pei Yang
60b0c630a7 lib: add mkSetLuaBinding 2024-08-17 13:03:54 +02:00
Ching Pei Yang
6b94991888 wrapper: use lzn-auto-require loader 2024-08-17 13:03:54 +02:00
Ching Pei Yang
ff214eb491 flake: add plugin lzn-auto-require 2024-08-17 13:03:54 +02:00
Ching Pei Yang
61dc161ef7 lz.n: generate less code 2024-08-17 13:03:54 +02:00
Ching Pei Yang
c80f303b0f lz.n: wrap lua code in function 2024-08-17 13:03:54 +02:00
Ching Pei Yang
a6568e64dd lib: add mkLznBinding 2024-08-17 13:03:54 +02:00
Ching Pei Yang
98bfd74de3 nvim-tree: load nvim-tree if openOnSetup 2024-08-17 13:03:54 +02:00
Ching Pei Yang
7260efac66 nvim-tree: move to lz.n keymaps 2024-08-17 13:03:54 +02:00
Ching Pei Yang
be6e41e876 lib: add mkLznBinding 2024-08-17 13:03:54 +02:00
Ching Pei Yang
8195ad5cc9 lib: change lz.n spec "inlineLua" types to str 2024-08-17 13:03:54 +02:00
Ching Pei Yang
ad5b928830 lz.n: missing type check 2024-08-17 13:03:54 +02:00
Ching Pei Yang
3fbef8cdb4 lib: add lznKeySpec example 2024-08-17 13:03:54 +02:00
Ching Pei Yang
fc63d2e0a1 lz.n: process key maps 2024-08-17 13:03:54 +02:00
Ching Pei Yang
980c80f0b8 remove unused 2024-08-17 13:03:54 +02:00
Pei Yang Ching
320d05aff2 lib: fix lz.n map type 2024-08-17 13:03:54 +02:00
Ching Pei Yang
1b661bacfd lib: add lz.n KeySpec 2024-08-17 13:03:54 +02:00
Pei Yang Ching
3763d71124 nvim-tree: use lazy 2024-08-17 13:03:54 +02:00
Pei Yang Ching
1e83f6f50b lazy: add setupOpts support 2024-08-17 13:03:54 +02:00
Pei Yang Ching
e07ff4029b fix: broken optPlugins 2024-08-17 13:03:54 +02:00
Pei Yang Ching
dee9fa0d61 switch to other hacky array-table syntax 2024-08-17 13:03:54 +02:00
Pei Yang Ching
7aef3392fd wrap lazy init code in function 2024-08-17 13:03:54 +02:00
Ching Pei Yang
4a8c83130d flake: update lz.n 2024-08-17 13:03:54 +02:00
Ching Pei Yang
8a0ffcb69f lib: add lznPluginTableType 2024-08-17 13:03:54 +02:00
Ching Pei Yang
8f92dd2dc1 lib: export lznPluginType 2024-08-17 13:03:54 +02:00
Ching Pei Yang
0d452bcaf7 lz.n: load lz.n 2024-08-17 13:03:54 +02:00
Ching Pei Yang
44681a4cb5 lz.n: add basic lazy.plugins option 2024-08-17 13:03:54 +02:00
Pei Yang Ching
b1a1aaba46 lib: add basic lz.n plugin spec type 2024-08-17 13:03:54 +02:00
Pei Yang Ching
b409800b2f add lazy module skeleton 2024-08-17 13:03:54 +02:00
Pei Yang Ching
ad8ce463f1 flake: add lz.n plugin 2024-08-17 13:03:54 +02:00
Pei Yang Ching
6d654ce4cd maps: fix missing description 2024-08-17 13:02:25 +02:00
Ching Pei Yang
202ea7570d remove unused 2024-08-17 12:55:55 +02:00
3 changed files with 36 additions and 20 deletions

View file

@ -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,
@ -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.";
@ -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 = 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 {

View file

@ -44,23 +44,7 @@
# legacy stuff
mapOption = submodule {
options =
mapConfigOptions
// {
action = mkOption {
type = str;
description = "The action to execute.";
};
lua = mkOption {
type = bool;
description = ''
If true, `action` is considered to be lua code.
Thus, it will not be wrapped in `""`.
'';
default = false;
};
};
options = mapConfigOptions;
};
mapOptions = mode:

View file

@ -37,7 +37,7 @@ in {
else keymap.action;
getOpts = keymap: {
inherit (keymap) silent nowait script expr unique noremap;
inherit (keymap) desc silent nowait script expr unique noremap;
};
toLuaKeymap = {