Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(harpoon): Update to v2 #741

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading