{ lib, config, ... }: lib.mkIf (lib.elem "nvim::harpoon" config.machine.pkgs) { programs.nvim-lazy.lazyPlugins = [ { dir = vPlug: vPlug.harpoon2; lazy = true; keys = [ { bind = "ha"; cmdIsFunction = true; cmd = # lua '' function() require("harpoon"):list():add() end ''; } { bind = "he"; cmdIsFunction = true; cmd = # lua '' function() local harpoon = require("harpoon") harpoon.ui:toggle_quick_menu(harpoon:list()) end ''; } { bind = ""; cmdIsFunction = true; cmd = # lua '' function() require("harpoon"):list():select(1) end ''; } { bind = ""; cmdIsFunction = true; cmd = # lua '' function() require("harpoon"):list():select(2) end ''; } { bind = ""; cmdIsFunction = true; cmd = # lua '' function() require("harpoon"):list():select(3) end ''; } { bind = ""; cmdIsFunction = true; cmd = # lua '' function() require("harpoon"):list():select(4) end ''; } ] ++ (map (num: { bind = "h${toString (lib.mod num 10)}"; cmdIsFunction = true; cmd = # lua '' function() require("harpoon"):list():select(${toString num}) end ''; }) (lib.range 1 10)); } ]; }