You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.5 KiB

  1. return {
  2. "ThePrimeagen/harpoon",
  3. branch = "harpoon2",
  4. dependencies = {
  5. "nvim-lua/plenary.nvim",
  6. },
  7. config = function()
  8. local harpoon = require("harpoon")
  9. -- REQUIRED
  10. harpoon:setup()
  11. -- REQUIRED
  12. local keymap = vim.keymap
  13. keymap.set("n", "<leader>a", function()
  14. harpoon:list():add()
  15. end, { desc = "Mark file with harpoon" })
  16. keymap.set("n", "<C-e>", function()
  17. harpoon.ui:toggle_quick_menu(harpoon:list())
  18. end, { desc = "Toggle quick menu for harpoon" })
  19. keymap.set("n", "<leader>1", function()
  20. harpoon:list():select(1)
  21. end, { desc = "Go to first harpoon file" })
  22. keymap.set("n", "<leader>h", function()
  23. harpoon:list():select(1)
  24. end, { desc = "Go to first harpoon file" })
  25. keymap.set("n", "<leader>2", function()
  26. harpoon:list():select(2)
  27. end, { desc = "Go to second harpoon file" })
  28. keymap.set("n", "<leader>j", function()
  29. harpoon:list():select(2)
  30. end, { desc = "Go to second harpoon file" })
  31. keymap.set("n", "<leader>3", function()
  32. harpoon:list():select(3)
  33. end, { desc = "Go to third harpoon file" })
  34. keymap.set("n", "<leader>k", function()
  35. harpoon:list():select(3)
  36. end, { desc = "Go to third harpoon file" })
  37. keymap.set("n", "<leader>4", function()
  38. harpoon:list():select(4)
  39. end, { desc = "Go to fourth harpoon file" })
  40. keymap.set("n", "<leader>l", function()
  41. harpoon:list():select(4)
  42. end, { desc = "Go to fourth harpoon file" })
  43. keymap.set("n", "<C-S-P>", function()
  44. harpoon:list():prev()
  45. end)
  46. keymap.set("n", "<C-S-N>", function()
  47. harpoon:list():next()
  48. end)
  49. end,
  50. }