summaryrefslogtreecommitdiff
path: root/lua/aotrix/plugins/harpoon.lua
blob: 69d176694512ddf2c4ce1f4e907c2088d95de102 (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({
            settings = {
                -- sets the marks upon calling `toggle` on the ui, instead of require `:w`.
                save_on_toggle = true
            }
        })
        vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
        vim.keymap.set("n", "<leader>hv", function()
            harpoon.ui:toggle_quick_menu(harpoon:list())
        end)
        vim.keymap.set("n", "<C-h>", function() harpoon:list():select(1) end)
        vim.keymap.set("n", "<C-l>", function() harpoon:list():select(2) end)
        vim.keymap.set("n", "<C-g>", function() harpoon:list():select(3) end)
        vim.keymap.set("n", "<C-m>", function() harpoon:list():select(4) end)
    end
}