From 5ed6f1188014c7b98eb157879fbb1d910f3d0467 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] 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 {