local map = vim.api.nvim_set_keymap local harpoon = require('harpoon') -- basic telescope configuration local conf = require("telescope.config").values local function toggle_telescope(harpoon_files) 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 -- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself vim.keymap.set('n', 'zR', require('ufo').openAllFolds) vim.keymap.set('n', 'zM', require('ufo').closeAllFolds) vim.keymap.set("n", "", function() toggle_telescope(harpoon:list()) end, { desc = "Open harpoon window" }) map('n', 'tt', " NvimTreeToggle", { noremap = true, desc = "Toggle directory tree" }) map('n', 'tf', " NvimTreeFindFile", { noremap = true, desc = "Go to current file in dir tree" }) map('n', 'ta', " AerialToggle", { noremap = true, desc = "Open aerial sidebar" }) map('n', 'tn', " AerialNavToggle", { noremap = true, desc = "Toggle aerial navigator" }) map('n', 'Z', " lua require('zen-mode').toggle({})", { noremap = true, desc = "Toggle zen mode" }) map('n', 'G', " Neogit", { noremap = true, desc = "Open Neogit" }) map('n', 'lz', "DevdocsOpenFloat", { noremap = true, desc = "Open devdocs viewer" }) vim.keymap.set("n", "", function() toggle_telescope(harpoon:list()) end, { desc = "Open harpoon window" })