-
-
Notifications
You must be signed in to change notification settings - Fork 408
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
[Harpoon 2] There is any way to do the same thing as mark_branch from Harpoon? #502
Comments
Hi @marcioflaviof, i was also missing this feature, but eventually found a quick way to add the functionality to harpoon2! I have looked into the main branch how the Here is my config (note that I am using lazy.nvim as my package manager): local Job = require "plenary.job"
local function get_os_command_output(cmd, cwd)
if type(cmd) ~= "table" then return {} end
local command = table.remove(cmd, 1)
local stderr = {}
local stdout, ret = Job:new({
command = command,
args = cmd,
cwd = cwd,
on_stderr = function(_, data) table.insert(stderr, data) end,
}):sync()
return stdout, ret, stderr
end
return {
{
"ThePrimeagen/harpoon",
branch = "harpoon2",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
},
opts = {
settings = {
save_on_toggle = true,
sync_on_ui_close = true,
key = function()
local branch = get_os_command_output({
"git",
"rev-parse",
"--abbrev-ref",
"HEAD",
})[1]
if branch then
return vim.loop.cwd() .. "-" .. branch
else
return vim.loop.cwd()
end
end,
},
},
} Hope this helps! |
It worked here, thanks @erik-schmidt |
@erik-schmidt |
Maybe it can be something related to this |
Hello guys, thanks for this awesome plugin, one feature that I used a lot from the original Harpoon was
mark_branch
but I didn't see anything like that on Harpoon2, there is any way in Harpoon2 to get this feature?The text was updated successfully, but these errors were encountered: