Skip to content

Commit

Permalink
feat(harpoon)!: Update to v2 (#741)
Browse files Browse the repository at this point in the history
* feat(harpoon): Update to v2 branch

* fix(harpoon): Remove invalid cmd table

---------

Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com>
  • Loading branch information
2 people authored and mehalter committed Feb 15, 2024
1 parent da69f6d commit 0151343
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions lua/astrocommunity/motion/harpoon/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,43 @@ require("astronvim.utils").set_mappings(maps)
return {
{
"ThePrimeagen/harpoon",
branch = "harpoon2",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
},
cmd = { "Harpoon" },
keys = {
{ prefix .. "a", function() require("harpoon.mark").add_file() end, desc = "Add file" },
{ prefix .. "e", function() require("harpoon.ui").toggle_quick_menu() end, desc = "Toggle quick menu" },
{ prefix .. "a", function() require("harpoon"):list():append() end, desc = "Add file" },
{
prefix .. "e",
function() require("harpoon").ui:toggle_quick_menu(require("harpoon"):list()) end,
desc = "Toggle quick menu",
},
{
"<C-x>",
function()
vim.ui.input({ prompt = "Harpoon mark index: " }, function(input)
local num = tonumber(input)
if num then require("harpoon.ui").nav_file(num) end
if num then require("harpoon"):list():select(num) end
end)
end,
desc = "Goto index of mark",
},
{ "<C-p>", function() require("harpoon.ui").nav_prev() end, desc = "Goto previous mark" },
{ "<C-n>", function() require("harpoon.ui").nav_next() end, desc = "Goto next mark" },
{ "<C-p>", function() require("harpoon"):list():prev() end, desc = "Goto previous mark" },
{ "<C-n>", function() require("harpoon"):list():next() end, desc = "Goto next mark" },
{ prefix .. "m", "<cmd>Telescope harpoon marks<CR>", desc = "Show marks in Telescope" },
{
prefix .. "t",
function()
vim.ui.input({ prompt = term_string .. " window number: " }, function(input)
local num = tonumber(input)
if num then require("harpoon." .. term_string).gotoTerminal(num) end
if num then require("harpoon").term.gotoTerminal(num) end
end)
end,
desc = "Go to " .. term_string .. " window",
},
},
opts = {},
},
{
"catppuccin/nvim",
Expand Down

0 comments on commit 0151343

Please sign in to comment.