aboutsummaryrefslogtreecommitdiffstats
path: root/lua/plugins/harpoon.lua
blob: a214924d004843803186124735b3142dcd69191c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
local keys = {}
local terms = 3
local binds = 5

table.insert(keys, {
  "<leader>ss",
  function()
    require("harpoon.ui").toggle_quick_menu()
  end,
  desc = "Harpoon Menu",
})

table.insert(keys, {
  "<leader>sa",
  function()
    require("harpoon.mark").add_file()
  end,
  desc = "Harpoon Add file",
})

table.insert(keys, {
  "<leader>st",
  function()
    vim.api.nvim_command [[vsplit]]
    require("harpoon.term").gotoTerminal(1)
    vim.api.nvim_command [[startinsert]]
  end,
  desc = "Harpoon quick split Terminal",
})

for i = 1, terms do
  table.insert(keys, {
    string.format("<leader><leader>%s", i),
    function()
      require("harpoon.term").gotoTerminal(i)
    end,
    desc = "Harpoon go to terminal " .. i,
  })
end

for i = 1, binds do
  table.insert(keys, {
    string.format("<leader>%s", i),
    function()
      require("harpoon.ui").nav_file(i)
    end,
    desc = "Harpoon go to file " .. i,
  })
end

return {
  "ThePrimeagen/harpoon",
  dependencies = {
    "nvim-lua/plenary.nvim",
    "nvim-lua/popup.nvim",
  },
  keys = keys,
  opts = {
    global_settings = {
      enter_on_sendcmd = true,
    },
    projects = {
      ["$HOME/code/svelte/snippets"] = {
        term = {
          cmds = {
            "npm run dev",
          },
        },
      },
    },
  },
}