Compare commits

..

33 commits

Author SHA1 Message Date
Ching Pei Yang
43e6e673af add TODO 2024-08-15 15:53:45 +02:00
Ching Pei Yang
1b82b13dc7 lib: allow luaInline in lz.n map action 2024-08-15 15:53:45 +02:00
Ching Pei Yang
f5850432a8 flake: update lzn-auto-require 2024-08-15 15:53:45 +02:00
Ching Pei Yang
f672689023 fixup! wrapper: use lzn-auto-require loader 2024-08-15 15:53:45 +02:00
Ching Pei Yang
669088244d lib: add mkSetLuaBinding 2024-08-15 15:53:45 +02:00
Ching Pei Yang
769e07e7cc wrapper: use lzn-auto-require loader 2024-08-15 15:53:45 +02:00
Ching Pei Yang
0b9f69a20f flake: add plugin lzn-auto-require 2024-08-15 15:52:34 +02:00
Ching Pei Yang
9dd2a11e4d lz.n: generate less code 2024-08-15 15:52:34 +02:00
Ching Pei Yang
09e83a6cec lz.n: wrap lua code in function 2024-08-15 15:52:34 +02:00
Ching Pei Yang
c027a87527 lib: add mkLznBinding 2024-08-15 15:52:34 +02:00
Ching Pei Yang
abd76db843 nvim-tree: load nvim-tree if openOnSetup 2024-08-15 15:52:34 +02:00
Ching Pei Yang
85c0839105 nvim-tree: move to lz.n keymaps 2024-08-15 15:52:34 +02:00
Ching Pei Yang
6fc691a7c3 lib: add mkLznBinding 2024-08-15 15:52:34 +02:00
Ching Pei Yang
14bc100a5e lib: change lz.n spec "inlineLua" types to str 2024-08-15 15:50:16 +02:00
Ching Pei Yang
290de58ae9 lz.n: missing type check 2024-08-15 15:50:16 +02:00
Ching Pei Yang
1ee0a513cc lib: add lznKeySpec example 2024-08-15 15:50:16 +02:00
Ching Pei Yang
346f536737 lz.n: process key maps 2024-08-15 15:50:16 +02:00
Ching Pei Yang
ee5a157894 remove unused 2024-08-15 15:50:16 +02:00
Pei Yang Ching
805dd05b39 lib: fix lz.n map type 2024-08-15 15:50:16 +02:00
Ching Pei Yang
d3e39d10b0 lib: add lz.n KeySpec 2024-08-15 15:50:16 +02:00
Pei Yang Ching
14061c6db5 nvim-tree: use lazy 2024-08-15 15:50:16 +02:00
Pei Yang Ching
5c105b8182 lazy: add setupOpts support 2024-08-15 15:50:16 +02:00
Pei Yang Ching
b10c525ffe fix: broken optPlugins 2024-08-15 15:50:16 +02:00
Pei Yang Ching
9b4332ed77 switch to other hacky array-table syntax 2024-08-15 15:50:16 +02:00
Pei Yang Ching
f632fa1a92 wrap lazy init code in function 2024-08-15 15:50:16 +02:00
Ching Pei Yang
0faf4b923b flake: update lz.n 2024-08-15 15:50:16 +02:00
Ching Pei Yang
205582135d lib: add lznPluginTableType 2024-08-15 15:50:16 +02:00
Ching Pei Yang
1988203073 lib: export lznPluginType 2024-08-15 15:50:16 +02:00
Ching Pei Yang
d1d91ff8a5 lz.n: load lz.n 2024-08-15 15:50:16 +02:00
Ching Pei Yang
b552b33077 lz.n: add basic lazy.plugins option 2024-08-15 15:50:16 +02:00
Pei Yang Ching
920e0bad5e lib: add basic lz.n plugin spec type 2024-08-15 15:50:16 +02:00
Pei Yang Ching
f3ce59ed40 add lazy module skeleton 2024-08-15 15:50:16 +02:00
Pei Yang Ching
50efc3b557 flake: add lz.n plugin 2024-08-15 15:50:16 +02:00
3 changed files with 20 additions and 36 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 int;
inherit (lib.types) submodule either package enum str lines attrsOf anything listOf nullOr oneOf bool;
# Get the names of all flake inputs that start with the given prefix.
fromInputs = {
inputs,
@ -138,18 +138,6 @@
# 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.";
@ -207,27 +195,7 @@
'';
};
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
'';
};
# TODO: enabled, beforeAll, colorscheme, priority, load
};
};
in {

View file

@ -44,7 +44,23 @@
# legacy stuff
mapOption = submodule {
options = mapConfigOptions;
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;
};
};
};
mapOptions = mode:

View file

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