summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/plugins/harpoon.lua
blob: 9ca692f679f5faaec15fbd79df87026c4bf4b4d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
return {
  "ThePrimeagen/harpoon",
  branch = "harpoon2",
  dependencies = { "nvim-lua/plenary.nvim" },
  config = function()
    local harpoon = require "harpoon"
    harpoon:setup()

    vim.keymap.set("n", "<m-h><m-m>", function()
      harpoon:list():add()
    end)
    vim.keymap.set("n", "<m-h><m-l>", function()
      harpoon.ui:toggle_quick_menu(harpoon:list())
    end)

    for _, idx in ipairs { 1, 2, 3, 4, 5 } do
      vim.keymap.set("n", string.format("<space>%d", idx), function()
        harpoon:list():select(idx)
      end)
    end
  end,
}