---
title: "💭 My harpoon config"
description: "!None"
date: 2024-04-16
published: true
tags:
  - vim
  - thought
template: link
---


<!-- embed not found: None -->
![[None]]

Install it

``` lua
	{
		"ThePrimeagen/harpoon",
		branch = "harpoon2",
		dependencies = { "nvim-lua/plenary.nvim" },
		config = function()
			require("waylonwalker.plugins.harpoon").setup()
		end,
	},
```

harpoon config

``` lua
local harpoon = require("harpoon")
M = {}

M.setup = function()

-- REQUIRED
harpoon:setup()
-- REQUIRED

vim.keymap.set("n", "<F10>", function() harpoon:list():append() end)
vim.keymap.set("n", "<F9>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)

vim.keymap.set("n", "<F1>", function() harpoon:list():select(1) end)
vim.keymap.set("n", "<F2>", function() harpoon:list():select(2) end)
vim.keymap.set("n", "<F3>", function() harpoon:list():select(3) end)
-- these are cnext/cprev
-- vim.keymap.set("n", "<F4>", function() harpoon:list():select(4) end)
-- vim.keymap.set("n", "<F5>", function() harpoon:list():select(5) end)
vim.keymap.set("n", "<F6>", function() harpoon:list():select(6) end)

-- Toggle previous & next buffers stored within Harpoon list
vim.keymap.set("n", "<F7>", function() harpoon:list():prev() end)
vim.keymap.set("n", "<F8>", function() harpoon:list():next() end)

-- 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

vim.keymap.set("n", "<C-e>", function() toggle_telescope(harpoon:list()) end,
    { desc = "Open harpoon window" })

end

return M
```

!!! note

    This post is a <a href="/thoughts/" class="wikilink" data-title="Thoughts" data-description="These are generally my thoughts on a web page or some sort of url, except a rare few don&#39;t have a link. These are dual published off of my..." data-date="2024-04-01">thought</a>. It's a short note that I make
    about someone else's content online <a href="/tags/thoughts/" class="hashtag-tag" data-tag="thoughts" data-count=2 data-reading-time=3 data-reading-time-text="3 minutes">#thoughts</a>
