{ config, lib, ... }: let leaderBinding = key: command: { key = "${key}"; action = "${command}"; options.silent = true; }; in { plugins.harpoon = { enable = true; enableTelescope = true; }; keymaps = lib.mkIf config.plugins.harpoon.enable ( [ { key = "a"; action.__raw = "function() require'harpoon':list():add() end"; } { key = ""; action.__raw = '' function() require 'harpoon'.ui:toggle_quick_menu(require'harpoon':list()) end ''; } ] ++ (map (num: leaderBinding "${toString num}" "lua require(\"harpoon\"):list():select(${toString num})") [ 1 2 3 4 5 6 7 8 9 ] ) ); }