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.

68 lines
1.6 KiB

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