From c027a87527382b77461f0ec17e535a01e31f6a0c 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] 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