---@type MappingsTable local M = {} local function toggle_telescope(harpoon_files) local conf = require("telescope.config").values local file_paths = {} for _, item in ipairs(harpoon_files.items) do table.insert(file_paths, item.value) end require("telescope.pickers").new({}, { prompt_title = "Harpoon", finder = require("telescope.finders").new_table({ results = file_paths, }), previewer = conf.file_previewer({}), sorter = conf.generic_sorter({}), }):find() end M.general = { n = { -- harpoon ["H"] = { function() local harpoon = require("harpoon") toggle_telescope(harpoon:list()) --harpoon.ui:toggle_quick_menu(harpoon:list()) end, "Open Harpoon in telescope", }, ["hh"] = { function() local harpoon = require("harpoon") harpoon.ui:toggle_quick_menu(harpoon:list()) end, "Open Harpoon", }, ["ha"] = { function() local harpoon = require("harpoon") harpoon:list():append() end, "Add file to Harpoon", }, ["hs"] = { function() local harpoon = require("harpoon") harpoon:list():select(1) end, "Switch to file 1", }, ["hd"] = { function() local harpoon = require("harpoon") harpoon:list():select(2) end, "Switch to file 2", }, ["hf"] = { function() local harpoon = require("harpoon") harpoon:list():select(3) end, "Switch to file 3", }, ["hg"] = { function() local harpoon = require("harpoon") harpoon:list():select(4) end, "Switch to file 4", }, -- navigation [""] = { "zz", "1/2 page down" }, [""] = { "zz", "1/2 page up" }, ["n"] = { "nzz", "find next" }, ["N"] = { "Nzz", "find prev" }, ["Zm"] = { ":ZenMode", "Enter ZenMode" }, }, } -- more keybinds! return M