From b8c8dc2484156d8f6f0cbb1dd1db0a1da3bd5503 Mon Sep 17 00:00:00 2001 From: Pei Yang Ching <59727193+horriblename@users.noreply.github.com> Date: Sun, 18 Aug 2024 14:16:44 +0200 Subject: [PATCH 01/43] maps: allow same key on multiple mode --- modules/neovim/mappings/config.nix | 70 +++++++++++++++++++---------- modules/neovim/mappings/options.nix | 36 ++++++++------- modules/wrapper/rc/config.nix | 45 +++++-------------- 3 files changed, 78 insertions(+), 73 deletions(-) diff --git a/modules/neovim/mappings/config.nix b/modules/neovim/mappings/config.nix index 365e124..b7e274b 100644 --- a/modules/neovim/mappings/config.nix +++ b/modules/neovim/mappings/config.nix @@ -3,32 +3,56 @@ lib, ... }: let - inherit (lib.modules) mkIf; + inherit (lib.modules) mkIf mkMerge; + inherit (builtins) mapAttrs; + + processLegacyMap = modes: legacyMap: [(legacyMap // {mode = modes;})]; cfg = config.vim; in { config = { - vim.maps = mkIf cfg.disableArrows { - "" = { - mode = ["n" "i"]; - action = ""; - noremap = false; - }; - "" = { - mode = ["n" "i"]; - action = ""; - noremap = false; - }; - "" = { - mode = ["n" "i"]; - action = ""; - noremap = false; - }; - "" = { - mode = ["n" "i"]; - action = ""; - noremap = false; - }; - }; + vim.keymaps = mkMerge [ + (mkIf cfg.disableArrows { + "" = [ + { + mode = ["n" "i"]; + action = ""; + noremap = false; + } + ]; + "" = [ + { + mode = ["n" "i"]; + action = ""; + noremap = false; + } + ]; + "" = [ + { + mode = ["n" "i"]; + action = ""; + noremap = false; + } + ]; + "" = [ + { + mode = ["n" "i"]; + action = ""; + noremap = false; + } + ]; + }) + (mapAttrs (_key: processLegacyMap "n") cfg.maps.normal) + (mapAttrs (_key: processLegacyMap "i") cfg.maps.insert) + (mapAttrs (_key: processLegacyMap "s") cfg.maps.select) + (mapAttrs (_key: processLegacyMap "v") cfg.maps.visual) + (mapAttrs (_key: processLegacyMap "t") cfg.maps.terminal) + (mapAttrs (_key: processLegacyMap "nvo") cfg.maps.normalVisualOp) + (mapAttrs (_key: processLegacyMap "nx") cfg.maps.visualOnly) + (mapAttrs (_key: processLegacyMap "o") cfg.maps.operator) + (mapAttrs (_key: processLegacyMap "ic") cfg.maps.insertCommand) + (mapAttrs (_key: processLegacyMap "l") cfg.maps.lang) + (mapAttrs (_key: processLegacyMap "c") cfg.maps.command) + ]; }; } diff --git a/modules/neovim/mappings/options.nix b/modules/neovim/mappings/options.nix index f422991..e16b787 100644 --- a/modules/neovim/mappings/options.nix +++ b/modules/neovim/mappings/options.nix @@ -38,6 +38,7 @@ See `:help map-modes` for a list of modes. ''; + example = ''"nvc" for normal, visual and command mode''; }; }; }; @@ -55,25 +56,10 @@ }; in { options.vim = { - maps = mkOption { + keymaps = mkOption { type = submodule { - freeformType = attrsOf mapType; - options = { - normal = mapOptions "normal"; - insert = mapOptions "insert"; - select = mapOptions "select"; - visual = mapOptions "visual and select"; - terminal = mapOptions "terminal"; - normalVisualOp = mapOptions "normal, visual, select and operator-pending (same as plain 'map')"; - - visualOnly = mapOptions "visual only"; - operator = mapOptions "operator-pending"; - insertCommand = mapOptions "insert and command-line"; - lang = mapOptions "insert, command-line and lang-arg"; - command = mapOptions "command-line"; - }; + freeformType = attrsOf (listOf mapType); }; - default = {}; description = "Custom keybindings."; example = '' maps = { @@ -84,6 +70,22 @@ in { }; # Same as nnoremap m make }; ''; + default = {}; + }; + + maps = { + normal = mapOptions "normal"; + insert = mapOptions "insert"; + select = mapOptions "select"; + visual = mapOptions "visual and select"; + terminal = mapOptions "terminal"; + normalVisualOp = mapOptions "normal, visual, select and operator-pending (same as plain 'map')"; + + visualOnly = mapOptions "visual only"; + operator = mapOptions "operator-pending"; + insertCommand = mapOptions "insert and command-line"; + lang = mapOptions "insert, command-line and lang-arg"; + command = mapOptions "command-line"; }; }; } diff --git a/modules/wrapper/rc/config.nix b/modules/wrapper/rc/config.nix index b3fd2e4..549c3fd 100644 --- a/modules/wrapper/rc/config.nix +++ b/modules/wrapper/rc/config.nix @@ -5,8 +5,8 @@ }: let inherit (builtins) map mapAttrs filter removeAttrs attrNames; inherit (lib.attrsets) mapAttrsToList filterAttrs attrsToList; - inherit (lib.strings) concatLines concatMapStringsSep; - inherit (lib.trivial) showWarnings; + inherit (lib.strings) concatLines concatMapStringsSep optionalString; + inherit (lib.trivial) showWarnings pipe; inherit (lib.generators) mkLuaInline; inherit (lib.nvim.dag) entryAfter mkLuarcSection resolveDag entryAnywhere; inherit (lib.nvim.lua) toLuaObject; @@ -40,40 +40,19 @@ in { inherit (keymap) desc silent nowait script expr unique noremap; }; - toLuaKeymap = { - name, - value, - }: "vim.keymap.set(${toLuaObject value.mode}, ${toLuaObject name}, ${toLuaObject (getAction value)}, ${toLuaObject (getOpts value)})"; - - namedModes = { - "normal" = ["n"]; - "insert" = ["i"]; - "select" = ["s"]; - "visual" = ["v"]; - "terminal" = ["t"]; - "normalVisualOp" = ["n" "v" "o"]; - "visualOnly" = ["n" "x"]; - "operator" = ["o"]; - "insertCommand" = ["i" "c"]; - "lang" = ["l"]; - "command" = ["c"]; - }; + toLuaKeymap = key: bind: "vim.keymap.set(${toLuaObject bind.mode}, ${toLuaObject key}, ${toLuaObject (getAction bind)}, ${toLuaObject (getOpts bind)})"; maps = - removeAttrs cfg.maps (attrNames namedModes) - // mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.normal;}) cfg.maps.normal - // mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.insert;}) cfg.maps.insert - // mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.select;}) cfg.maps.select - // mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.visual;}) cfg.maps.visual - // mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.terminal;}) cfg.maps.terminal - // mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.normalVisualOp;}) cfg.maps.normalVisualOp - // mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.visualOnly;}) cfg.maps.visualOnly - // mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.operator;}) cfg.maps.operator - // mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.insertCommand;}) cfg.maps.insertCommand - // mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.lang;}) cfg.maps.lang - // mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.command;}) cfg.maps.command; + pipe + # attrsOf (listOf mapOption) + cfg.keymaps + [ + (mapAttrsToList (key: binds: + concatLines (map (toLuaKeymap key) binds))) + concatLines + ]; - keymaps = concatLines (map toLuaKeymap (attrsToList (filterNonNull maps))); + keymaps = maps; in { vim = { luaConfigRC = { From fd4ddbdd39e34b0f07fc94768f66bacfbb56d050 Mon Sep 17 00:00:00 2001 From: Pei Yang Ching <59727193+horriblename@users.noreply.github.com> Date: Sun, 18 Aug 2024 15:04:32 +0200 Subject: [PATCH 02/43] maps: fix bad mode names --- modules/neovim/mappings/config.nix | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/neovim/mappings/config.nix b/modules/neovim/mappings/config.nix index b7e274b..a620e37 100644 --- a/modules/neovim/mappings/config.nix +++ b/modules/neovim/mappings/config.nix @@ -42,17 +42,17 @@ in { } ]; }) - (mapAttrs (_key: processLegacyMap "n") cfg.maps.normal) - (mapAttrs (_key: processLegacyMap "i") cfg.maps.insert) - (mapAttrs (_key: processLegacyMap "s") cfg.maps.select) - (mapAttrs (_key: processLegacyMap "v") cfg.maps.visual) - (mapAttrs (_key: processLegacyMap "t") cfg.maps.terminal) - (mapAttrs (_key: processLegacyMap "nvo") cfg.maps.normalVisualOp) - (mapAttrs (_key: processLegacyMap "nx") cfg.maps.visualOnly) - (mapAttrs (_key: processLegacyMap "o") cfg.maps.operator) - (mapAttrs (_key: processLegacyMap "ic") cfg.maps.insertCommand) - (mapAttrs (_key: processLegacyMap "l") cfg.maps.lang) - (mapAttrs (_key: processLegacyMap "c") cfg.maps.command) + (mapAttrs (_key: processLegacyMap ["n"]) cfg.maps.normal) + (mapAttrs (_key: processLegacyMap ["i"]) cfg.maps.insert) + (mapAttrs (_key: processLegacyMap ["s"]) cfg.maps.select) + (mapAttrs (_key: processLegacyMap ["v"]) cfg.maps.visual) + (mapAttrs (_key: processLegacyMap ["t"]) cfg.maps.terminal) + (mapAttrs (_key: processLegacyMap ["n" "v" "o"]) cfg.maps.normalVisualOp) + (mapAttrs (_key: processLegacyMap ["n" "x"]) cfg.maps.visualOnly) + (mapAttrs (_key: processLegacyMap ["o"]) cfg.maps.operator) + (mapAttrs (_key: processLegacyMap ["i" "c"]) cfg.maps.insertCommand) + (mapAttrs (_key: processLegacyMap ["l"]) cfg.maps.lang) + (mapAttrs (_key: processLegacyMap ["c"]) cfg.maps.command) ]; }; } From 34b462a744fe4705bde099948c9b27189792944e Mon Sep 17 00:00:00 2001 From: Pei Yang Ching <59727193+horriblename@users.noreply.github.com> Date: Fri, 23 Aug 2024 14:16:07 +0200 Subject: [PATCH 03/43] keymaps: use listOf mapOption instead --- modules/neovim/mappings/config.nix | 65 +++++++++++++++++++---------- modules/neovim/mappings/options.nix | 14 ++++--- modules/wrapper/rc/config.nix | 7 ++-- 3 files changed, 54 insertions(+), 32 deletions(-) diff --git a/modules/neovim/mappings/config.nix b/modules/neovim/mappings/config.nix index a620e37..4d7f241 100644 --- a/modules/neovim/mappings/config.nix +++ b/modules/neovim/mappings/config.nix @@ -4,55 +4,74 @@ ... }: let inherit (lib.modules) mkIf mkMerge; - inherit (builtins) mapAttrs; + inherit (lib.trivial) pipe; + inherit (lib.attrsets) mapAttrsToList; + inherit (lib.lists) flatten; - processLegacyMap = modes: legacyMap: [(legacyMap // {mode = modes;})]; + legacyMapModes = { + normal = ["n"]; + insert = ["i"]; + select = ["s"]; + visual = ["v"]; + terminal = ["t"]; + normalVisualOp = ["n" "v" "o"]; + visualOnly = ["n" "x"]; + operator = ["o"]; + insertCommand = ["i" "c"]; + lang = ["l"]; + command = ["c"]; + }; cfg = config.vim; in { config = { vim.keymaps = mkMerge [ - (mkIf cfg.disableArrows { - "" = [ + ( + mkIf cfg.disableArrows [ { + key = ""; mode = ["n" "i"]; action = ""; noremap = false; } - ]; - "" = [ { + key = ""; mode = ["n" "i"]; action = ""; noremap = false; } - ]; - "" = [ { + key = ""; mode = ["n" "i"]; action = ""; noremap = false; } - ]; - "" = [ { + key = ""; mode = ["n" "i"]; action = ""; noremap = false; } - ]; - }) - (mapAttrs (_key: processLegacyMap ["n"]) cfg.maps.normal) - (mapAttrs (_key: processLegacyMap ["i"]) cfg.maps.insert) - (mapAttrs (_key: processLegacyMap ["s"]) cfg.maps.select) - (mapAttrs (_key: processLegacyMap ["v"]) cfg.maps.visual) - (mapAttrs (_key: processLegacyMap ["t"]) cfg.maps.terminal) - (mapAttrs (_key: processLegacyMap ["n" "v" "o"]) cfg.maps.normalVisualOp) - (mapAttrs (_key: processLegacyMap ["n" "x"]) cfg.maps.visualOnly) - (mapAttrs (_key: processLegacyMap ["o"]) cfg.maps.operator) - (mapAttrs (_key: processLegacyMap ["i" "c"]) cfg.maps.insertCommand) - (mapAttrs (_key: processLegacyMap ["l"]) cfg.maps.lang) - (mapAttrs (_key: processLegacyMap ["c"]) cfg.maps.command) + ] + ) + ( + pipe cfg.maps + [ + (mapAttrsToList ( + oldMode: keybinds: + mapAttrsToList ( + key: bind: + bind + // { + inherit key; + mode = legacyMapModes.${oldMode}; + } + ) + keybinds + )) + flatten + ] + ) ]; }; } diff --git a/modules/neovim/mappings/options.nix b/modules/neovim/mappings/options.nix index e16b787..5538d98 100644 --- a/modules/neovim/mappings/options.nix +++ b/modules/neovim/mappings/options.nix @@ -31,6 +31,12 @@ options = mapConfigOptions // { + key = mkOption { + type = str; + description = '' + Key that triggers this keybind. + ''; + }; mode = mkOption { type = either str (listOf str); description = '' @@ -44,22 +50,20 @@ }; # legacy stuff - mapOption = submodule { + legacyMapOption = submodule { options = mapConfigOptions; }; mapOptions = mode: mkOption { description = "Mappings for ${mode} mode"; - type = attrsOf mapOption; + type = attrsOf legacyMapOption; default = {}; }; in { options.vim = { keymaps = mkOption { - type = submodule { - freeformType = attrsOf (listOf mapType); - }; + type = listOf mapType; description = "Custom keybindings."; example = '' maps = { diff --git a/modules/wrapper/rc/config.nix b/modules/wrapper/rc/config.nix index 549c3fd..41db014 100644 --- a/modules/wrapper/rc/config.nix +++ b/modules/wrapper/rc/config.nix @@ -40,15 +40,14 @@ in { inherit (keymap) desc silent nowait script expr unique noremap; }; - toLuaKeymap = key: bind: "vim.keymap.set(${toLuaObject bind.mode}, ${toLuaObject key}, ${toLuaObject (getAction bind)}, ${toLuaObject (getOpts bind)})"; + toLuaKeymap = bind: "vim.keymap.set(${toLuaObject bind.mode}, ${toLuaObject bind.key}, ${toLuaObject (getAction bind)}, ${toLuaObject (getOpts bind)})"; maps = pipe - # attrsOf (listOf mapOption) + # listOf mapOption cfg.keymaps [ - (mapAttrsToList (key: binds: - concatLines (map (toLuaKeymap key) binds))) + (map toLuaKeymap) concatLines ]; From 71727e5378e4e01ae80d2dbc976ef51deb4355d8 Mon Sep 17 00:00:00 2001 From: Pei Yang Ching <59727193+horriblename@users.noreply.github.com> Date: Fri, 23 Aug 2024 14:16:07 +0200 Subject: [PATCH 04/43] keymaps: update example --- modules/neovim/mappings/options.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/modules/neovim/mappings/options.nix b/modules/neovim/mappings/options.nix index 5538d98..49e7249 100644 --- a/modules/neovim/mappings/options.nix +++ b/modules/neovim/mappings/options.nix @@ -66,13 +66,20 @@ in { type = listOf mapType; description = "Custom keybindings."; example = '' - maps = { - "m" = { + vim.keymaps = [ + { + key = "m"; mode = "n"; silent = true; - action = "make"; - }; # Same as nnoremap m make - }; + action = ":make"; + } + { + key = "l"; + mode = ["n" "x"]; + silent = true; + action = "cnext"; + } + ]; ''; default = {}; }; From aa040ab53865e2eb2f39cbc3b0da8d822c0c2776 Mon Sep 17 00:00:00 2001 From: Pei Yang Ching <59727193+horriblename@users.noreply.github.com> Date: Fri, 23 Aug 2024 14:16:07 +0200 Subject: [PATCH 05/43] remove unneeded pipe --- modules/wrapper/rc/config.nix | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/modules/wrapper/rc/config.nix b/modules/wrapper/rc/config.nix index 41db014..586243a 100644 --- a/modules/wrapper/rc/config.nix +++ b/modules/wrapper/rc/config.nix @@ -6,7 +6,7 @@ inherit (builtins) map mapAttrs filter removeAttrs attrNames; inherit (lib.attrsets) mapAttrsToList filterAttrs attrsToList; inherit (lib.strings) concatLines concatMapStringsSep optionalString; - inherit (lib.trivial) showWarnings pipe; + inherit (lib.trivial) showWarnings; inherit (lib.generators) mkLuaInline; inherit (lib.nvim.dag) entryAfter mkLuarcSection resolveDag entryAnywhere; inherit (lib.nvim.lua) toLuaObject; @@ -42,14 +42,7 @@ in { toLuaKeymap = bind: "vim.keymap.set(${toLuaObject bind.mode}, ${toLuaObject bind.key}, ${toLuaObject (getAction bind)}, ${toLuaObject (getOpts bind)})"; - maps = - pipe - # listOf mapOption - cfg.keymaps - [ - (map toLuaKeymap) - concatLines - ]; + maps = concatLines (map toLuaKeymap cfg.keymaps); keymaps = maps; in { From feccaf477a302e5d154f9728eead642d9a8bc860 Mon Sep 17 00:00:00 2001 From: Pei Yang Ching <59727193+horriblename@users.noreply.github.com> Date: Fri, 23 Aug 2024 14:16:07 +0200 Subject: [PATCH 06/43] cleanup unused import --- modules/wrapper/rc/config.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/wrapper/rc/config.nix b/modules/wrapper/rc/config.nix index 586243a..14ef8f0 100644 --- a/modules/wrapper/rc/config.nix +++ b/modules/wrapper/rc/config.nix @@ -3,9 +3,9 @@ lib, ... }: let - inherit (builtins) map mapAttrs filter removeAttrs attrNames; - inherit (lib.attrsets) mapAttrsToList filterAttrs attrsToList; - inherit (lib.strings) concatLines concatMapStringsSep optionalString; + inherit (builtins) map mapAttrs filter; + inherit (lib.attrsets) mapAttrsToList filterAttrs; + inherit (lib.strings) concatLines concatMapStringsSep; inherit (lib.trivial) showWarnings; inherit (lib.generators) mkLuaInline; inherit (lib.nvim.dag) entryAfter mkLuarcSection resolveDag entryAnywhere; From b2eae85e799713a4bdf44c9c363f2d5934f25dce Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 17 Aug 2024 12:55:55 +0200 Subject: [PATCH 07/43] remove unused From b6c1a7145e93aa38b11e0d687df8010c8501e1a0 Mon Sep 17 00:00:00 2001 From: Pei Yang Ching <59727193+horriblename@users.noreply.github.com> Date: Sat, 17 Aug 2024 13:02:03 +0200 Subject: [PATCH 08/43] maps: fix missing description From 6d7d5ee1903ae3a750e3689d19c733bb35ca75f1 Mon Sep 17 00:00:00 2001 From: Pei Yang Ching Date: Tue, 25 Jun 2024 17:10:43 +0200 Subject: [PATCH 09/43] flake: add lz.n plugin --- flake.lock | 17 +++++++++++++++++ flake.nix | 6 ++++++ 2 files changed, 23 insertions(+) diff --git a/flake.lock b/flake.lock index 1851eb7..4644afe 100644 --- a/flake.lock +++ b/flake.lock @@ -843,6 +843,22 @@ "type": "github" } }, + "plugin-lz-n": { + "flake": false, + "locked": { + "lastModified": 1719248596, + "narHash": "sha256-GBDmumQ0XYxawPdUncI6fW413MMSjGl6TwCQTexUpnE=", + "owner": "nvim-neorocks", + "repo": "lz.n", + "rev": "24f9fe1024c936d9fa6a5607b73a4ae1958c9d77", + "type": "github" + }, + "original": { + "owner": "nvim-neorocks", + "repo": "lz.n", + "type": "github" + } + }, "plugin-mind-nvim": { "flake": false, "locked": { @@ -1872,6 +1888,7 @@ "plugin-lspkind": "plugin-lspkind", "plugin-lspsaga": "plugin-lspsaga", "plugin-lualine": "plugin-lualine", + "plugin-lz-n": "plugin-lz-n", "plugin-mind-nvim": "plugin-mind-nvim", "plugin-minimap-vim": "plugin-minimap-vim", "plugin-modes-nvim": "plugin-modes-nvim", diff --git a/flake.nix b/flake.nix index c00e9b8..131c21d 100644 --- a/flake.nix +++ b/flake.nix @@ -102,6 +102,12 @@ }; ## Plugins + # Lazy loading + plugin-lz-n = { + url = "github:nvim-neorocks/lz.n"; + flake = false; + }; + # LSP plugins plugin-nvim-lspconfig = { url = "github:neovim/nvim-lspconfig"; From 6cd336394220c74399d62b3911ef744b036c8025 Mon Sep 17 00:00:00 2001 From: Pei Yang Ching Date: Tue, 25 Jun 2024 17:16:49 +0200 Subject: [PATCH 10/43] add lazy module skeleton --- modules/modules.nix | 1 + modules/wrapper/lazy/config.nix | 14 ++++++++++++++ modules/wrapper/lazy/default.nix | 6 ++++++ modules/wrapper/lazy/lazy.nix | 15 +++++++++++++++ 4 files changed, 36 insertions(+) create mode 100644 modules/wrapper/lazy/config.nix create mode 100644 modules/wrapper/lazy/default.nix create mode 100644 modules/wrapper/lazy/lazy.nix diff --git a/modules/modules.nix b/modules/modules.nix index a00cea6..a995754 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -50,6 +50,7 @@ wrapper = map (p: ./wrapper + "/${p}") [ "build" "rc" + "lazy" "warnings" ]; diff --git a/modules/wrapper/lazy/config.nix b/modules/wrapper/lazy/config.nix new file mode 100644 index 0000000..53df6ae --- /dev/null +++ b/modules/wrapper/lazy/config.nix @@ -0,0 +1,14 @@ +{ + lib, + config, + ... +}: let + inherit (lib.modules) mkIf; + cfg = config.vim.lazy; +in { + config.vim = mkIf cfg.enable { + startPlugins = ["lz-n"]; + + # optPlugins = + }; +} diff --git a/modules/wrapper/lazy/default.nix b/modules/wrapper/lazy/default.nix new file mode 100644 index 0000000..fa40127 --- /dev/null +++ b/modules/wrapper/lazy/default.nix @@ -0,0 +1,6 @@ +_: { + imports = [ + ./lazy.nix + ./config.nix + ]; +} diff --git a/modules/wrapper/lazy/lazy.nix b/modules/wrapper/lazy/lazy.nix new file mode 100644 index 0000000..0b11ab1 --- /dev/null +++ b/modules/wrapper/lazy/lazy.nix @@ -0,0 +1,15 @@ +{lib, ...}: let + inherit (lib.options) mkOption mkEnableOption; + inherit (lib.types) enum; +in { + options.vim.lazy = { + enable = mkEnableOption "plugin lazy-loading" // {default = true;}; + loader = mkOption { + description = "Lazy loader to use"; + type = enum ["lz.n"]; + default = "lz.n"; + }; + + # plugins = mkOption {}; + }; +} From 3800a1c0165bd801f30b139b05ad184dce63e1dd Mon Sep 17 00:00:00 2001 From: Pei Yang Ching Date: Tue, 25 Jun 2024 17:47:33 +0200 Subject: [PATCH 11/43] lib: add basic lz.n plugin spec type --- lib/types/plugins.nix | 81 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 73 insertions(+), 8 deletions(-) diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index c0e89d6..b590ed5 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -6,8 +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; - + inherit (lib.types) submodule either package enum str lines attrsOf anything listOf nullOr oneOf; # Get the names of all flake inputs that start with the given prefix. fromInputs = { inputs, @@ -51,8 +50,79 @@ }; }; }; + + luaInline = lib.mkOptionType { + name = "luaInline"; + check = x: lib.nvim.lua.isLuaInline x; + }; + + lznPluginType = submodule { + options = { + ## Should probably infer from the actual plugin somehow + ## In general this is the name passed to packadd, so the dir name of the plugin + # name = mkOption { + # type= str; + # } + + package = pluginType; + + before = mkOption { + type = nullOr luaInline; + description = "Code to run before plugin is loaded"; + default = null; + }; + + after = mkOption { + type = nullOr luaInline; + description = "Code to run after plugin is loaded"; + default = null; + }; + + event = mkOption { + description = "Lazy-load on event"; + default = "null"; + type = let + event = submodule { + options = { + event = mkOption { + type = nullOr (either str (listOf str)); + description = "Exact event name"; + example = "BufEnter"; + }; + pattern = mkOption { + type = nullOr (either str (listOf str)); + description = "Event pattern"; + example = "BufEnter *.lua"; + }; + }; + }; + in + oneOf [str (listOf str) event]; + }; + + cmd = mkOption { + description = "Lazy-load on command"; + default = null; + type = nullOr (either str (listOf str)); + }; + + ft = mkOption { + description = "Lazy-load on filetype"; + default = null; + type = nullOr (either str (listOf str)); + }; + + keys = mkOption { + description = "Lazy-load on key mapping"; + default = null; + type = nullOr (either str (listOf str)); # TODO: support lz.n.KeysSpec + }; + + # TODO: enabled, beforeAll, colorscheme, priority, load + }; + }; in { - inherit extraPluginType fromInputs pluginType; + inherit extraPluginType fromInputs pluginType luaInline lznPluginType; pluginsOpt = { description, @@ -64,11 +134,6 @@ in { type = pluginsType; }; - luaInline = lib.mkOptionType { - name = "luaInline"; - check = x: lib.nvim.lua.isLuaInline x; - }; - /* opts is a attrset of options, example: ``` From 7abd0f8626b213ffe02dd8f58f58f9939cfa274b Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Wed, 10 Jul 2024 00:28:10 +0200 Subject: [PATCH 12/43] lz.n: add basic lazy.plugins option --- modules/wrapper/lazy/lazy.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/wrapper/lazy/lazy.nix b/modules/wrapper/lazy/lazy.nix index 0b11ab1..90ae055 100644 --- a/modules/wrapper/lazy/lazy.nix +++ b/modules/wrapper/lazy/lazy.nix @@ -1,6 +1,7 @@ {lib, ...}: let inherit (lib.options) mkOption mkEnableOption; inherit (lib.types) enum; + inherit (lib.nvim.types) lznPluginTableType; in { options.vim.lazy = { enable = mkEnableOption "plugin lazy-loading" // {default = true;}; @@ -10,6 +11,19 @@ in { default = "lz.n"; }; - # plugins = mkOption {}; + plugins = mkOption { + default = {}; + type = lznPluginTableType; + description = "list of plugins to lazy load"; + example = '' + { + toggleterm-nvim = { + package = "toggleterm-nvim"; + after = "require('toggleterm').setup{}"; + cmd = ["ToggleTerm"]; + }; + } + ''; + }; }; } From 6e3292f2c42dbb6f3f3e4fdef8d88728bf495990 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Wed, 10 Jul 2024 00:28:18 +0200 Subject: [PATCH 13/43] lz.n: load lz.n --- modules/wrapper/lazy/config.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/wrapper/lazy/config.nix b/modules/wrapper/lazy/config.nix index 53df6ae..a2bd73a 100644 --- a/modules/wrapper/lazy/config.nix +++ b/modules/wrapper/lazy/config.nix @@ -3,12 +3,26 @@ config, ... }: let + inherit (builtins) toJSON; inherit (lib.modules) mkIf; + inherit (lib.attrsets) mapAttrsToList; + inherit (lib.generators) mkLuaInline; + inherit (lib.nvim.lua) toLuaObject; + inherit (lib.nvim.dag) entryAnywhere; cfg = config.vim.lazy; + + toLznSpec = name: plugin: + (removeAttrs plugin ["package"]) + // {__HACK = mkLuaInline "nil, [1] = ${toJSON name}";}; + lznSpecs = mapAttrsToList toLznSpec cfg.plugins; in { config.vim = mkIf cfg.enable { startPlugins = ["lz-n"]; - # optPlugins = + optPlugins = mapAttrsToList (_: plugin: plugin.package) cfg.plugins; + + luaConfigRC.lzn-load = entryAnywhere '' + require('lz.n').load(${toLuaObject lznSpecs}) + ''; }; } From 7648cb8c7e0dea92514cc273cf0ac05eccc49662 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Wed, 10 Jul 2024 00:52:42 +0200 Subject: [PATCH 14/43] lib: export lznPluginType --- lib/types/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/types/default.nix b/lib/types/default.nix index 928bbae..98c64cc 100644 --- a/lib/types/default.nix +++ b/lib/types/default.nix @@ -9,7 +9,7 @@ typesCustom = import ./custom.nix {inherit lib;}; in { inherit (typesDag) dagOf; - inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType; + inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType lznPluginType; inherit (typesLanguage) diagnostics mkGrammarOption; inherit (typesCustom) anythingConcatLists char; } From 5a045d2ea0d564eb8543f1034573291c5dcb82ed Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Wed, 10 Jul 2024 01:40:11 +0200 Subject: [PATCH 15/43] lib: add lznPluginTableType --- lib/types/default.nix | 2 +- lib/types/plugins.nix | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/types/default.nix b/lib/types/default.nix index 98c64cc..170667d 100644 --- a/lib/types/default.nix +++ b/lib/types/default.nix @@ -9,7 +9,7 @@ typesCustom = import ./custom.nix {inherit lib;}; in { inherit (typesDag) dagOf; - inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType lznPluginType; + inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType lznPluginType lznPluginTableType; inherit (typesLanguage) diagnostics mkGrammarOption; inherit (typesCustom) anythingConcatLists char; } diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index b590ed5..fd8e8bb 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -56,6 +56,7 @@ check = x: lib.nvim.lua.isLuaInline x; }; + lznPluginTableType = attrsOf lznPluginType; lznPluginType = submodule { options = { ## Should probably infer from the actual plugin somehow @@ -64,7 +65,9 @@ # type= str; # } - package = pluginType; + package = mkOption { + type = pluginType; + }; before = mkOption { type = nullOr luaInline; @@ -80,7 +83,7 @@ event = mkOption { description = "Lazy-load on event"; - default = "null"; + default = null; type = let event = submodule { options = { @@ -97,7 +100,7 @@ }; }; in - oneOf [str (listOf str) event]; + nullOr (oneOf [str (listOf str) event]); }; cmd = mkOption { @@ -122,7 +125,7 @@ }; }; in { - inherit extraPluginType fromInputs pluginType luaInline lznPluginType; + inherit extraPluginType fromInputs pluginType luaInline lznPluginType lznPluginTableType; pluginsOpt = { description, From 5745fd8103af0d4d213843e4246d60952036aab3 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Wed, 10 Jul 2024 01:40:26 +0200 Subject: [PATCH 16/43] flake: update lz.n --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 4644afe..263a5c2 100644 --- a/flake.lock +++ b/flake.lock @@ -846,11 +846,11 @@ "plugin-lz-n": { "flake": false, "locked": { - "lastModified": 1719248596, - "narHash": "sha256-GBDmumQ0XYxawPdUncI6fW413MMSjGl6TwCQTexUpnE=", + "lastModified": 1719989949, + "narHash": "sha256-oHwmlLgdJJDz5+gs1KLAa2MHQAadM/JYmHGfep9yl28=", "owner": "nvim-neorocks", "repo": "lz.n", - "rev": "24f9fe1024c936d9fa6a5607b73a4ae1958c9d77", + "rev": "4c790ba2c3789f580aa019712bbe3112f85e73a0", "type": "github" }, "original": { From 56a3d45ac786c97adaed4f0fecda87bc416d9150 Mon Sep 17 00:00:00 2001 From: Pei Yang Ching <59727193+horriblename@users.noreply.github.com> Date: Wed, 10 Jul 2024 12:39:53 +0200 Subject: [PATCH 17/43] wrap lazy init code in function --- modules/wrapper/lazy/lazy.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/wrapper/lazy/lazy.nix b/modules/wrapper/lazy/lazy.nix index 90ae055..151c087 100644 --- a/modules/wrapper/lazy/lazy.nix +++ b/modules/wrapper/lazy/lazy.nix @@ -19,7 +19,7 @@ in { { toggleterm-nvim = { package = "toggleterm-nvim"; - after = "require('toggleterm').setup{}"; + after = lib.generators.mkLuaInline "function() require('toggleterm').setup{} end"; cmd = ["ToggleTerm"]; }; } From 57828912bbb0ce3694152aede4f6035cf5ca228a Mon Sep 17 00:00:00 2001 From: Pei Yang Ching <59727193+horriblename@users.noreply.github.com> Date: Wed, 10 Jul 2024 13:00:41 +0200 Subject: [PATCH 18/43] switch to other hacky array-table syntax --- modules/wrapper/lazy/config.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/wrapper/lazy/config.nix b/modules/wrapper/lazy/config.nix index a2bd73a..749a320 100644 --- a/modules/wrapper/lazy/config.nix +++ b/modules/wrapper/lazy/config.nix @@ -3,18 +3,16 @@ config, ... }: let - inherit (builtins) toJSON; inherit (lib.modules) mkIf; inherit (lib.attrsets) mapAttrsToList; - inherit (lib.generators) mkLuaInline; inherit (lib.nvim.lua) toLuaObject; inherit (lib.nvim.dag) entryAnywhere; cfg = config.vim.lazy; - toLznSpec = name: plugin: + toLuaLznSpec = name: plugin: (removeAttrs plugin ["package"]) - // {__HACK = mkLuaInline "nil, [1] = ${toJSON name}";}; - lznSpecs = mapAttrsToList toLznSpec cfg.plugins; + // {"@1" = name;}; + lznSpecs = mapAttrsToList toLuaLznSpec cfg.plugins; in { config.vim = mkIf cfg.enable { startPlugins = ["lz-n"]; From 23c6f319cd0564f431f6d76bd03598e6746e3462 Mon Sep 17 00:00:00 2001 From: Pei Yang Ching <59727193+horriblename@users.noreply.github.com> Date: Wed, 24 Jul 2024 12:36:49 +0200 Subject: [PATCH 19/43] fix: broken optPlugins --- modules/default.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/default.nix b/modules/default.nix index 1ae3b03..8a436d5 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -69,10 +69,7 @@ inputs: { # built (or "normalized") plugins that are modified builtStartPlugins = buildConfigPlugins vimOptions.startPlugins; - builtOptPlugins = map (package: { - plugin = package; - optional = true; - }) (buildConfigPlugins vimOptions.optPlugins); + builtOptPlugins = map (package: package // {optional = true;}) (buildConfigPlugins vimOptions.optPlugins); # additional Lua and Python3 packages, mapped to their respective functions # to conform to the format mnw expects. end user should From 659c4b5ca2b518360614849b12d0c57b5a89d22d Mon Sep 17 00:00:00 2001 From: Pei Yang Ching <59727193+horriblename@users.noreply.github.com> Date: Wed, 24 Jul 2024 12:52:47 +0200 Subject: [PATCH 20/43] lazy: add setupOpts support --- lib/types/plugins.nix | 17 +++++++++++++++++ modules/wrapper/lazy/config.nix | 20 +++++++++++++++++--- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index fd8e8bb..ca5c614 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -65,10 +65,27 @@ # type= str; # } + # Non-lz.n options + package = mkOption { type = pluginType; + description = "Plugin package"; }; + setupModule = mkOption { + type = nullOr str; + description = "Lua module to run setup function on."; + default = null; + }; + + setupOpts = mkOption { + type = submodule {freeformType = attrsOf anything;}; + description = "Options to pass to the setup function"; + default = {}; + }; + + # lz.n options + before = mkOption { type = nullOr luaInline; description = "Code to run before plugin is loaded"; diff --git a/modules/wrapper/lazy/config.nix b/modules/wrapper/lazy/config.nix index 749a320..5e25939 100644 --- a/modules/wrapper/lazy/config.nix +++ b/modules/wrapper/lazy/config.nix @@ -3,15 +3,29 @@ config, ... }: let + inherit (builtins) toJSON; inherit (lib.modules) mkIf; inherit (lib.attrsets) mapAttrsToList; + inherit (lib.generators) mkLuaInline; + inherit (lib.strings) optionalString; inherit (lib.nvim.lua) toLuaObject; inherit (lib.nvim.dag) entryAnywhere; cfg = config.vim.lazy; - toLuaLznSpec = name: plugin: - (removeAttrs plugin ["package"]) - // {"@1" = name;}; + toLuaLznSpec = name: spec: + (removeAttrs spec ["package" "setupModule" "setupOpts"]) + // { + "@1" = name; + after = mkLuaInline '' + function() + ${ + optionalString (spec.setupModule != null) + "require(${toJSON spec.setupModule}).setup(${toLuaObject spec.setupOpts})" + } + ${optionalString (spec.after != null) spec.after} + end + ''; + }; lznSpecs = mapAttrsToList toLuaLznSpec cfg.plugins; in { config.vim = mkIf cfg.enable { From 4014ab0a01f2ac04d9a262a28686ad53f78cc681 Mon Sep 17 00:00:00 2001 From: Pei Yang Ching <59727193+horriblename@users.noreply.github.com> Date: Wed, 24 Jul 2024 13:23:53 +0200 Subject: [PATCH 21/43] nvim-tree: use lazy --- modules/plugins/filetree/nvimtree/config.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/plugins/filetree/nvimtree/config.nix b/modules/plugins/filetree/nvimtree/config.nix index b97b1e4..f1e75b5 100644 --- a/modules/plugins/filetree/nvimtree/config.nix +++ b/modules/plugins/filetree/nvimtree/config.nix @@ -16,8 +16,6 @@ inherit (self.options.vim.filetree.nvimTree) mappings; in { config = mkIf cfg.enable { - vim.startPlugins = ["nvim-tree-lua"]; - vim.maps.normal = mkMerge [ (mkBinding cfg.mappings.toggle ":NvimTreeToggle" mappings.toggle.description) (mkBinding cfg.mappings.refresh ":NvimTreeRefresh" mappings.refresh.description) @@ -29,6 +27,17 @@ in { "t" = "+NvimTree"; }; + vim.lazy = { + plugins = { + nvim-tree-lua = { + package = "nvim-tree-lua"; + setupModule = "nvim-tree"; + inherit (cfg) setupOpts; + cmd = ["NvimTreeClipboard" "NvimTreeClose" "NvimTreeCollapse" "NvimTreeCollapseKeepBuffers" "NvimTreeFindFile" "NvimTreeFindFileToggle" "NvimTreeFocus" "NvimTreeHiTest" "NvimTreeOpen" "NvimTreeRefresh" "NvimTreeResize" "NvimTreeToggle"]; + }; + }; + }; + vim.pluginRC.nvimtreelua = entryAnywhere '' ${ optionalString cfg.setupOpts.disable_netrw '' @@ -38,8 +47,6 @@ in { '' } - require'nvim-tree'.setup(${toLuaObject cfg.setupOpts}) - ${ optionalString cfg.openOnSetup '' -- autostart behaviour From d660aae9befa47dc826ab4c040c9b5559036d343 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Thu, 1 Aug 2024 22:33:51 +0200 Subject: [PATCH 22/43] lib: add lz.n KeySpec --- lib/types/plugins.nix | 62 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 2 deletions(-) diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index ca5c614..7e65abc 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -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; + 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, @@ -56,6 +56,64 @@ check = x: lib.nvim.lua.isLuaInline x; }; + lznKeysSpec = submodule { + apply = x: + x + // { + "@1" = x.lhs; + "@2" = x.rhs; + }; + + options = { + desc = mkOption { + description = "Description of the key map"; + type = nullOr str; + default = null; + }; + + noremap = mkOption { + description = "TBD"; + type = bool; + default = false; + }; + + expr = mkOption { + description = "TBD"; + type = bool; + default = false; + }; + + nowait = mkOption { + description = "TBD"; + type = bool; + default = false; + }; + + ft = mkOption { + description = "TBD"; + type = nullOr (listOf str); + default = null; + }; + + lhs = mkOption { + type = str; + description = "Key to bind to"; + }; + + rhs = mkOption { + type = nullOr str; + default = null; + description = "Action to trigger"; + }; + + mode = mkOption { + description = "Modes to bind in"; + type = listOf str; + default = ["n"]; + }; + }; + }; + lznPluginTableType = attrsOf lznPluginType; lznPluginType = submodule { options = { @@ -135,7 +193,7 @@ keys = mkOption { description = "Lazy-load on key mapping"; default = null; - type = nullOr (either str (listOf str)); # TODO: support lz.n.KeysSpec + type = nullOr (oneOf [str (listOf str) lznKeysSpec]); # TODO: support lz.n.KeysSpec }; # TODO: enabled, beforeAll, colorscheme, priority, load From bd6c228e5c452dfeeaba2bb8a6132a57a9cf62be Mon Sep 17 00:00:00 2001 From: Pei Yang Ching <59727193+horriblename@users.noreply.github.com> Date: Fri, 2 Aug 2024 13:10:20 +0200 Subject: [PATCH 23/43] lib: fix lz.n map type --- lib/types/plugins.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index 7e65abc..c993f1d 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -109,7 +109,7 @@ mode = mkOption { description = "Modes to bind in"; type = listOf str; - default = ["n"]; + default = ["n" "x" "s" "o"]; }; }; }; @@ -193,7 +193,7 @@ keys = mkOption { description = "Lazy-load on key mapping"; default = null; - type = nullOr (oneOf [str (listOf str) lznKeysSpec]); # TODO: support lz.n.KeysSpec + type = nullOr (oneOf [str (listOf lznKeysSpec) (listOf str)]); # TODO: support lz.n.KeysSpec }; # TODO: enabled, beforeAll, colorscheme, priority, load From f683cd36e08d0dcc75b085e7ec3d6a8306ad430a Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 3 Aug 2024 14:45:29 +0200 Subject: [PATCH 24/43] remove unused --- lib/types/plugins.nix | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index c993f1d..7fa7448 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -57,13 +57,6 @@ }; lznKeysSpec = submodule { - apply = x: - x - // { - "@1" = x.lhs; - "@2" = x.rhs; - }; - options = { desc = mkOption { description = "Description of the key map"; From 5eadc2937d8451f2eba6469fba95be284c3b0ec7 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 3 Aug 2024 14:45:48 +0200 Subject: [PATCH 25/43] lz.n: process key maps --- modules/wrapper/lazy/config.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/modules/wrapper/lazy/config.nix b/modules/wrapper/lazy/config.nix index 5e25939..645dfb9 100644 --- a/modules/wrapper/lazy/config.nix +++ b/modules/wrapper/lazy/config.nix @@ -12,8 +12,23 @@ inherit (lib.nvim.dag) entryAnywhere; cfg = config.vim.lazy; + toLuzLznKeySpec = { + desc, + noremap, + expr, + nowait, + ft, + lhs, + rhs, + mode, + }: { + "@1" = lhs; + "@2" = rhs; + inherit desc noremap expr nowait ft mode; + }; + toLuaLznSpec = name: spec: - (removeAttrs spec ["package" "setupModule" "setupOpts"]) + (removeAttrs spec ["package" "setupModule" "setupOpts" "keys"]) // { "@1" = name; after = mkLuaInline '' @@ -25,6 +40,7 @@ ${optionalString (spec.after != null) spec.after} end ''; + keys = map toLuzLznKeySpec spec.keys; }; lznSpecs = mapAttrsToList toLuaLznSpec cfg.plugins; in { From 146fcf25e6cf8c42f2ef95e98a745d72e05c0538 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 3 Aug 2024 16:38:42 +0200 Subject: [PATCH 26/43] lib: add lznKeySpec example --- lib/types/plugins.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index 7fa7448..f328aae 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -186,7 +186,12 @@ keys = mkOption { description = "Lazy-load on key mapping"; default = null; - type = nullOr (oneOf [str (listOf lznKeysSpec) (listOf str)]); # TODO: support lz.n.KeysSpec + type = nullOr (oneOf [str (listOf lznKeysSpec) (listOf str)]); + example = '' + keys = [ + {lhs = "s"; rhs = ":NvimTreeToggle"; desc = "Toggle NvimTree"} + ] + ''; }; # TODO: enabled, beforeAll, colorscheme, priority, load From 90dd876c53a8fd4b64f911d59fbb12b6e2089c1d Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 3 Aug 2024 18:01:34 +0200 Subject: [PATCH 27/43] lz.n: missing type check --- modules/wrapper/lazy/config.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/wrapper/lazy/config.nix b/modules/wrapper/lazy/config.nix index 645dfb9..5ce308b 100644 --- a/modules/wrapper/lazy/config.nix +++ b/modules/wrapper/lazy/config.nix @@ -3,7 +3,7 @@ config, ... }: let - inherit (builtins) toJSON; + inherit (builtins) toJSON typeOf head length; inherit (lib.modules) mkIf; inherit (lib.attrsets) mapAttrsToList; inherit (lib.generators) mkLuaInline; @@ -40,7 +40,10 @@ ${optionalString (spec.after != null) spec.after} end ''; - keys = map toLuzLznKeySpec spec.keys; + keys = + if typeOf spec.keys == "list" && length spec.keys > 0 && typeOf (head spec.keys) == "set" + then map toLuzLznKeySpec spec.keys + else spec.keys; }; lznSpecs = mapAttrsToList toLuaLznSpec cfg.plugins; in { From b1cc8bb27b4685cdfb1554bb6956e9c438928452 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 3 Aug 2024 18:05:33 +0200 Subject: [PATCH 28/43] lib: change lz.n spec "inlineLua" types to str --- lib/types/plugins.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index f328aae..84bf78a 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -138,14 +138,14 @@ # lz.n options before = mkOption { - type = nullOr luaInline; - description = "Code to run before plugin is loaded"; + type = nullOr str; + description = "Lua code to run before plugin is loaded. This will be wrapped in a function."; default = null; }; after = mkOption { - type = nullOr luaInline; - description = "Code to run after plugin is loaded"; + type = nullOr str; + description = "Lua code to run after plugin is loaded. This will be wrapped in a function."; default = null; }; From 6d2d9cd60e5c3e09a77871e01920ac628b30286b Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 3 Aug 2024 18:41:41 +0200 Subject: [PATCH 29/43] lib: add mkLznBinding --- lib/binds.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/binds.nix b/lib/binds.nix index 8c9e9a6..ae16d73 100644 --- a/lib/binds.nix +++ b/lib/binds.nix @@ -67,6 +67,10 @@ mkLuaBinding binding.value action binding.description; pushDownDefault = attr: mapAttrs (_: mkDefault) attr; + + mkLznBinding = mode: lhs: rhs: desc: { + inherit mode lhs rhs desc; + }; }; in binds From 6fe0103209db046cd8055c164cbedfe74ba8bbbf Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 3 Aug 2024 14:46:05 +0200 Subject: [PATCH 30/43] nvim-tree: move to lz.n keymaps --- modules/plugins/filetree/nvimtree/config.nix | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/plugins/filetree/nvimtree/config.nix b/modules/plugins/filetree/nvimtree/config.nix index f1e75b5..9e9d4e3 100644 --- a/modules/plugins/filetree/nvimtree/config.nix +++ b/modules/plugins/filetree/nvimtree/config.nix @@ -4,11 +4,11 @@ pkgs, ... }: let + inherit (builtins) filter; inherit (lib.strings) optionalString; - inherit (lib.modules) mkIf mkMerge; - inherit (lib.nvim.binds) mkBinding; + inherit (lib.modules) mkIf; + inherit (lib.nvim.binds) mkLznBinding; inherit (lib.nvim.dag) entryAnywhere; - inherit (lib.nvim.lua) toLuaObject; inherit (lib.nvim.binds) pushDownDefault; cfg = config.vim.filetree.nvimTree; @@ -16,13 +16,6 @@ inherit (self.options.vim.filetree.nvimTree) mappings; in { config = mkIf cfg.enable { - vim.maps.normal = mkMerge [ - (mkBinding cfg.mappings.toggle ":NvimTreeToggle" mappings.toggle.description) - (mkBinding cfg.mappings.refresh ":NvimTreeRefresh" mappings.refresh.description) - (mkBinding cfg.mappings.findFile ":NvimTreeFindFile" mappings.findFile.description) - (mkBinding cfg.mappings.focus ":NvimTreeFocus" mappings.focus.description) - ]; - vim.binds.whichKey.register = pushDownDefault { "t" = "+NvimTree"; }; @@ -34,6 +27,13 @@ in { setupModule = "nvim-tree"; inherit (cfg) setupOpts; cmd = ["NvimTreeClipboard" "NvimTreeClose" "NvimTreeCollapse" "NvimTreeCollapseKeepBuffers" "NvimTreeFindFile" "NvimTreeFindFileToggle" "NvimTreeFocus" "NvimTreeHiTest" "NvimTreeOpen" "NvimTreeRefresh" "NvimTreeResize" "NvimTreeToggle"]; + + keys = filter ({lhs, ...}: lhs != null) [ + (mkLznBinding ["n"] cfg.mappings.toggle ":NvimTreeToggle" mappings.toggle.description) + (mkLznBinding ["n"] cfg.mappings.refresh ":NvimTreeRefresh" mappings.refresh.description) + (mkLznBinding ["n"] cfg.mappings.findFile ":NvimTreeFindFile" mappings.findFile.description) + (mkLznBinding ["n"] cfg.mappings.focus ":NvimTreeFocus" mappings.focus.description) + ]; }; }; }; From 217079b546bb9f91d4eea956715b5aed0db3bb57 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 3 Aug 2024 16:59:41 +0200 Subject: [PATCH 31/43] nvim-tree: load nvim-tree if openOnSetup --- modules/plugins/filetree/nvimtree/config.nix | 1 + modules/wrapper/lazy/config.nix | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/plugins/filetree/nvimtree/config.nix b/modules/plugins/filetree/nvimtree/config.nix index 9e9d4e3..47a85d6 100644 --- a/modules/plugins/filetree/nvimtree/config.nix +++ b/modules/plugins/filetree/nvimtree/config.nix @@ -49,6 +49,7 @@ in { ${ optionalString cfg.openOnSetup '' + require('lz.n').trigger_load("nvim-tree-lua") -- autostart behaviour -- Open on startup has been deprecated -- see https://github.com/nvim-tree/nvim-tree.lua/wiki/Open-At-Startup diff --git a/modules/wrapper/lazy/config.nix b/modules/wrapper/lazy/config.nix index 5ce308b..b1afb5b 100644 --- a/modules/wrapper/lazy/config.nix +++ b/modules/wrapper/lazy/config.nix @@ -9,7 +9,7 @@ inherit (lib.generators) mkLuaInline; inherit (lib.strings) optionalString; inherit (lib.nvim.lua) toLuaObject; - inherit (lib.nvim.dag) entryAnywhere; + inherit (lib.nvim.dag) entryBefore; cfg = config.vim.lazy; toLuzLznKeySpec = { @@ -52,7 +52,7 @@ in { optPlugins = mapAttrsToList (_: plugin: plugin.package) cfg.plugins; - luaConfigRC.lzn-load = entryAnywhere '' + luaConfigRC.lzn-load = entryBefore ["pluginConfigs"] '' require('lz.n').load(${toLuaObject lznSpecs}) ''; }; From cfaa2e3e77baaa3f3fa1c078c535de58aa104943 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 3 Aug 2024 19:18:25 +0200 Subject: [PATCH 32/43] lib: add mkLznBinding --- lib/binds.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/binds.nix b/lib/binds.nix index ae16d73..61fec95 100644 --- a/lib/binds.nix +++ b/lib/binds.nix @@ -71,6 +71,24 @@ mkLznBinding = mode: lhs: rhs: desc: { inherit mode lhs rhs desc; }; + + # Usage: + # + # ``` + # vim.lazy.plugins = { + # telescope = { + # # ... + # keys = builtins.filter ({lhs, ...}: lhs != null) [ + # mkSetLznBinding mapping ":Telescope" + # ]; + # } + # } + # ``` + mkSetLznBinding = binding: action: { + lhs = binding.value; + rhs = action; + desc = binding.description; + }; }; in binds From 4c230a0460bcca98617e6ec2af28b0821d24a322 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 3 Aug 2024 19:46:52 +0200 Subject: [PATCH 33/43] lz.n: wrap lua code in function --- modules/wrapper/lazy/config.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/wrapper/lazy/config.nix b/modules/wrapper/lazy/config.nix index b1afb5b..38be892 100644 --- a/modules/wrapper/lazy/config.nix +++ b/modules/wrapper/lazy/config.nix @@ -31,6 +31,15 @@ (removeAttrs spec ["package" "setupModule" "setupOpts" "keys"]) // { "@1" = name; + before = + if spec.before != null + then + mkLuaInline '' + function() + ${spec.before} + end + '' + else null; after = mkLuaInline '' function() ${ From 3a88caeda664cbad523a1edca007f59f191be880 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 3 Aug 2024 19:48:13 +0200 Subject: [PATCH 34/43] lz.n: generate less code --- modules/wrapper/lazy/config.nix | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/modules/wrapper/lazy/config.nix b/modules/wrapper/lazy/config.nix index 38be892..b3fdb7d 100644 --- a/modules/wrapper/lazy/config.nix +++ b/modules/wrapper/lazy/config.nix @@ -40,15 +40,21 @@ end '' else null; - after = mkLuaInline '' - function() - ${ - optionalString (spec.setupModule != null) - "require(${toJSON spec.setupModule}).setup(${toLuaObject spec.setupOpts})" - } - ${optionalString (spec.after != null) spec.after} - end - ''; + + after = + if spec.setupModule == null && spec.after == null + then null + else + mkLuaInline '' + function() + ${ + optionalString (spec.setupModule != null) + "require(${toJSON spec.setupModule}).setup(${toLuaObject spec.setupOpts})" + } + ${optionalString (spec.after != null) spec.after} + end + ''; + keys = if typeOf spec.keys == "list" && length spec.keys > 0 && typeOf (head spec.keys) == "set" then map toLuzLznKeySpec spec.keys From 4e13acfac33f6ee3788139217c444f474ef07076 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 3 Aug 2024 22:21:32 +0200 Subject: [PATCH 35/43] flake: add plugin lzn-auto-require --- flake.lock | 17 +++++++++++++++++ flake.nix | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/flake.lock b/flake.lock index 263a5c2..634a707 100644 --- a/flake.lock +++ b/flake.lock @@ -859,6 +859,22 @@ "type": "github" } }, + "plugin-lzn-auto-require": { + "flake": false, + "locked": { + "lastModified": 1722716302, + "narHash": "sha256-YehBjQ4m3i0yEnts7HhWW78N6g40hblfcl94d7l9aN4=", + "owner": "horriblename", + "repo": "lzn-auto-require", + "rev": "57567c9db26a3b5b143ae91f35143c34706e8881", + "type": "github" + }, + "original": { + "owner": "horriblename", + "repo": "lzn-auto-require", + "type": "github" + } + }, "plugin-mind-nvim": { "flake": false, "locked": { @@ -1889,6 +1905,7 @@ "plugin-lspsaga": "plugin-lspsaga", "plugin-lualine": "plugin-lualine", "plugin-lz-n": "plugin-lz-n", + "plugin-lzn-auto-require": "plugin-lzn-auto-require", "plugin-mind-nvim": "plugin-mind-nvim", "plugin-minimap-vim": "plugin-minimap-vim", "plugin-modes-nvim": "plugin-modes-nvim", diff --git a/flake.nix b/flake.nix index 131c21d..8468bd2 100644 --- a/flake.nix +++ b/flake.nix @@ -108,6 +108,11 @@ flake = false; }; + plugin-lzn-auto-require = { + url = "github:horriblename/lzn-auto-require"; + flake = false; + }; + # LSP plugins plugin-nvim-lspconfig = { url = "github:neovim/nvim-lspconfig"; From 7075872810483ca16e9ece67f1b0edf8b7032f61 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 3 Aug 2024 22:28:51 +0200 Subject: [PATCH 36/43] wrapper: use lzn-auto-require loader --- modules/wrapper/rc/config.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/wrapper/rc/config.nix b/modules/wrapper/rc/config.nix index 14ef8f0..5662b65 100644 --- a/modules/wrapper/rc/config.nix +++ b/modules/wrapper/rc/config.nix @@ -5,7 +5,7 @@ }: let inherit (builtins) map mapAttrs filter; inherit (lib.attrsets) mapAttrsToList filterAttrs; - inherit (lib.strings) concatLines concatMapStringsSep; + inherit (lib.strings) concatLines concatMapStringsSep optionalString; inherit (lib.trivial) showWarnings; inherit (lib.generators) mkLuaInline; inherit (lib.nvim.dag) entryAfter mkLuarcSection resolveDag entryAnywhere; @@ -53,6 +53,8 @@ in { pluginConfigs = entryAfter ["theme"] pluginConfigs; extraPluginConfigs = entryAfter ["pluginConfigs"] extraPluginConfigs; mappings = entryAfter ["extraPluginConfigs"] keymaps; + # FIXME: put this somewhere less stupid + footer = entryAfter ["mappings"] (optionalString config.vim.lazy.enable "require('lzn-auto-require.loader').register_loader()"); }; builtLuaConfigRC = let From 0daad3e51a2e1112030081d9bdf0c3b5638953bd Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 3 Aug 2024 22:33:09 +0200 Subject: [PATCH 37/43] lib: add mkSetLuaBinding --- lib/binds.nix | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/lib/binds.nix b/lib/binds.nix index 61fec95..f8f915e 100644 --- a/lib/binds.nix +++ b/lib/binds.nix @@ -3,6 +3,7 @@ inherit (lib.modules) mkIf mkDefault; inherit (lib.types) nullOr str; inherit (lib.attrsets) isAttrs mapAttrs; + inherit (lib.generators) mkLuaInline; binds = rec { mkLuaBinding = key: action: desc: @@ -72,23 +73,17 @@ inherit mode lhs rhs desc; }; - # Usage: - # - # ``` - # vim.lazy.plugins = { - # telescope = { - # # ... - # keys = builtins.filter ({lhs, ...}: lhs != null) [ - # mkSetLznBinding mapping ":Telescope" - # ]; - # } - # } - # ``` mkSetLznBinding = binding: action: { lhs = binding.value; rhs = action; desc = binding.description; }; + + mkSetLuaLznBinding = binding: action: { + lhs = binding.value; + rhs = mkLuaInline "function() ${action} end"; + desc = binding.description; + }; }; in binds From 39ebfbcd98b6ecec74714c38abb617d1f7f04a1f Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 3 Aug 2024 22:46:06 +0200 Subject: [PATCH 38/43] fixup! wrapper: use lzn-auto-require loader --- modules/wrapper/lazy/config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/wrapper/lazy/config.nix b/modules/wrapper/lazy/config.nix index b3fdb7d..7baefa4 100644 --- a/modules/wrapper/lazy/config.nix +++ b/modules/wrapper/lazy/config.nix @@ -63,7 +63,7 @@ lznSpecs = mapAttrsToList toLuaLznSpec cfg.plugins; in { config.vim = mkIf cfg.enable { - startPlugins = ["lz-n"]; + startPlugins = ["lz-n" "lzn-auto-require"]; optPlugins = mapAttrsToList (_: plugin: plugin.package) cfg.plugins; From 6d42de8aba67c244bd24f0a80fba587eb61667b2 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sun, 4 Aug 2024 02:23:30 +0200 Subject: [PATCH 39/43] flake: update lzn-auto-require --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 634a707..2d56f9f 100644 --- a/flake.lock +++ b/flake.lock @@ -862,11 +862,11 @@ "plugin-lzn-auto-require": { "flake": false, "locked": { - "lastModified": 1722716302, - "narHash": "sha256-YehBjQ4m3i0yEnts7HhWW78N6g40hblfcl94d7l9aN4=", + "lastModified": 1722727896, + "narHash": "sha256-h7Dx3zBkUYamQY6lcuQrwAMgBpPqskLnA6WsbefHzMU=", "owner": "horriblename", "repo": "lzn-auto-require", - "rev": "57567c9db26a3b5b143ae91f35143c34706e8881", + "rev": "c6b47e148a1ff9709e802f68c2c8b558a9a8de9b", "type": "github" }, "original": { From c991b2adea5b796f64ed101e69543f6d37f2940f Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sun, 4 Aug 2024 02:24:10 +0200 Subject: [PATCH 40/43] lib: allow luaInline in lz.n map action --- lib/types/plugins.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index 84bf78a..d6dc79a 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -94,9 +94,9 @@ }; rhs = mkOption { - type = nullOr str; + type = nullOr (either str luaInline); default = null; - description = "Action to trigger"; + description = "Action to trigger. luaInline code will be wrapped in a function."; }; mode = mkOption { From ca86aaa3af501012a3084caeb941f3685de0687c Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sun, 4 Aug 2024 02:27:59 +0200 Subject: [PATCH 41/43] add TODO --- lib/types/plugins.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index d6dc79a..86f6101 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -96,6 +96,7 @@ rhs = mkOption { type = nullOr (either str luaInline); default = null; + # FIXME: use a separate flag to indicate lua instead of luaInline description = "Action to trigger. luaInline code will be wrapped in a function."; }; From 7bace58ab4c9cb8756e927788614b63204f61248 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 17 Aug 2024 13:19:12 +0200 Subject: [PATCH 42/43] lz.n: add missing PluginSpec options --- lib/types/plugins.nix | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index 86f6101..d83c48f 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -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 = 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 { From 477f2fb8c753797cb7c3a9942e6a85019f815527 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 17 Aug 2024 15:43:03 +0200 Subject: [PATCH 43/43] flake: update lzn-auto-require --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 2d56f9f..56d380b 100644 --- a/flake.lock +++ b/flake.lock @@ -862,11 +862,11 @@ "plugin-lzn-auto-require": { "flake": false, "locked": { - "lastModified": 1722727896, - "narHash": "sha256-h7Dx3zBkUYamQY6lcuQrwAMgBpPqskLnA6WsbefHzMU=", + "lastModified": 1723928740, + "narHash": "sha256-CMWy+btqUaXUWSO4jZYDfBcNiYMFyRb8jtIdi072WP8=", "owner": "horriblename", "repo": "lzn-auto-require", - "rev": "c6b47e148a1ff9709e802f68c2c8b558a9a8de9b", + "rev": "1b9f6527e32bf196ce239f7a8b9a54d342605511", "type": "github" }, "original": {