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

My Thoughts on Harpoon #255

Closed
ThePrimeagen opened this issue Feb 21, 2023 · 13 comments
Closed

My Thoughts on Harpoon #255

ThePrimeagen opened this issue Feb 21, 2023 · 13 comments

Comments

@ThePrimeagen
Copy link
Owner

When i started creating harpoon, i didn't know what I wanted.

I thought,

  • i want to control terminal sessions in neovim
  • i want a fast way to go to a file i have been using
  • a simple way to move file ordering
  • send commands to terminal sessions

After 2 years of using harpoon i realized the terminal stuff, i think was a mistake.

More so, the tmux + harpoon stuff feels like a mistake now. I hate the code base, i want to rewrite it, but i don't want to break anyone.

If you are wondering why i haven't been merging much of ANYTHING here is because i am worried. this project slowly got out of my control and lost its focus.


I am REALLY trying to keep harpoon light. its so easy to let everyone's ideas come in and take the project in so many directions that it sucks. Part of me wants to rethink harpoon from the ground up, part of me wants to create a wholly new version that emits events and allows more the "plugin" style. I don't know what to do, and appreciate any thoughts :)

PS, it sucks maintaining open source

@catgoose
Copy link

I use harpoon to create "temporary marks". There are other plugins like grapple.nvim that offer a similar solution, but nothing I have found is as easy and "trigger finger friendly" as harpoon. I use a to add marks and l to open harpoon selection. I think this is the core of harpoon and tasks, terminals, etc should be handled by other plugins or extensions of harpoon.
I know other people have different use cases and I want the plugin to function as I use it, but that's all I use harpoon for.

@primeapple
Copy link

I never liked (and used) the terminal/tmux integration.
I mark files with gh, open the harpoon UI with gH . I move to the nth file with ngh (n is a number here).
The function is

            local function toggle_move()
                if (vim.v.count > 0) then
                    return '<cmd>lua require("harpoon.ui").nav_file(vim.v.count) <CR>'
                else
                    require('harpoon.mark').toggle_file()
                end
            end

There are 2 options I see:

  • Create a whole new repo (like the creator of lightspeed.nvim did with leap.nvim
  • Create a new branch rewrite in this repo. Rewrite the plugin there. As soon as you are finished, publish it in branch v1. Remove all references to the old master branch in the README, make the users use the v1 branch. Keep developing in rewrite, merge it regularly in v1 (if breaking changes, create v2). At one point, when you feel save, merge rewrite into master.

Most of the ideas are stolen from:
https://phaazon.net/blog/neovim-plugins-stability

@aldevv
Copy link
Contributor

aldevv commented Feb 23, 2023

you could try making harpoon into a plugin that lets users extend it by creating their own plugins, ex: harpoon-terminal, harpoon-tmux, harpoon-worktrees. And then you could maintain core harpoon just for marking files, this way harpoon stays cohesive and other users get to have their own specific use-cases

@vuki656
Copy link

vuki656 commented Feb 28, 2023

I use it to mark up to 5 files and then navigate to those 5 files, occasionally reorder them. Thats it. That's what you initially presented and it works great.

Everything else seems like a scope creep.

@cbochs
Copy link

cbochs commented Mar 4, 2023

I use harpoon to create "temporary marks". There are other plugins like grapple.nvim that offer a similar solution, but nothing I have found is as easy and "trigger finger friendly" as harpoon. I use a to add marks and l to open harpoon selection. I think this is the core of harpoon and tasks, terminals, etc should be handled by other plugins or extensions of harpoon. I know other people have different use cases and I want the plugin to function as I use it, but that's all I use harpoon for.

@catgoose Out of genuine curiosity, what is it about grapple.nvim that creates more friction than harpoon? I say this because - reading the comments here - these are the exact reasons I originally wrote Grapple. That is, to create a plugin that strips away all the "extra" features and focuses solely on the concept of file tagging / marking.

Harpoon is an amazing plugin and some of its features are unparalleled. I'm truly excited to see how a rewrite would turn out. However, I think understanding where Grapple is missing the mark (pun intended) can help a ton in deciding what the next steps for harpoon could be.

@timothyis
Copy link

More so, the tmux + harpoon stuff feels like a mistake now. I hate the code base, i want to rewrite it, but i don't want to break anyone.
If you are wondering why i haven't been merging much of ANYTHING here is because i am worried. this project slowly got out of my control and lost its focus.

It feels like in this case, Harpoon is pretty feature complete. Maybe transition ownership to someone that has interest in this version of the plugin and then create a new plugin, as you say, from the ground up. I don't think open-source needs to be a long term commitment in cases like this, if the project is good enough to be used as intended or if there are others available to maintain.

Sounds like a pretty great idea, and I'd bet you'll feel motivated creating something new as you're thinking about it already. Use the drive!

(I have this exact same feeling with my open-source app, so I'm in the same boat)

@ghost
Copy link

ghost commented Mar 19, 2023

If you need a new name for a new similar project @ThePrimeagen, as a zelda fan, I personally think hookshot.nvim would be a rad name

@kecerud
Copy link

kecerud commented Mar 31, 2023

I use it to mark up to 5 files and then navigate to those 5 files, occasionally reorder them. Thats it. That's what you initially presented and it works great.

Everything else seems like a scope creep.

Facts 🔝

@miker
Copy link

miker commented Apr 13, 2023

Sounds like converting to a plugin system is the way to go.

Strip harpoon down to it's core, then let everything else be added\removed via plugins. That lets everyone make harpoon do what they want for their specific use case. There might be a small hiccup during the cutover from current way to using plugins but that really sounds like the best way.

This allows you to manage the core of Harpoon and let you focus on what you think is important and what Harpoon should be, and everything else can be farmed out to plugin maintainers.

How hard would it be to convert Harpoon into using plugins? Seems to me this would make a fantastic YouTube series 🙂

@matu3ba
Copy link

matu3ba commented Jul 20, 2023

Not sure, why you are not doing the obvious: Make it a low-level lib, which transparently provides all errors to the user.

If you want to provide a way for the user to control all buffers + allow attaching metadata, then you could use https://github.com/matu3ba/libbuf.nvim.
Unfortunately, harpoon works good enough for my use cases and using lua for DOD feels not very satisfying to me (plus lua is slow for hashing unless using luajit), so I never finished this one.

Feel free to steal the code, but be warned that I have not finished the storing to disk and loading. And the harpoon part.

@masaeedu
Copy link

@ThePrimeagen Hello there. I'm not a user of Harpoon (yet?) so take this with a healthy dose of skepticism: but it I feel like it's not super clear from either of the READMEs (for v1 and v2) what Harpoon is. Maybe it would help focus people's efforts if your vision was more clearly asserted in the README?

The V2 has this description of problems and solutions:

⇁ The Problems

  • You're working on a codebase. medium, large, tiny, whatever. You find yourself frequenting a small set of files and you are tired of using a fuzzy finder, :bnext & :bprev are getting too repetitive, alternate file doesn't quite cut it, etc etc.
  • You want to execute some project specific commands, have any number of persistent terminals that can be easily navigated to, send commands to other tmux windows, or dream up your own custom action and execute with a single key

⇁ The Solutions

  • Specify either by altering a ui or by adding via hot key files
  • Unlimited lists and items within the lists

Those do sound like problems I have, but everything (the problems, the solutions, the connection between them) is a bit abstract. Maybe I just need to play around with it to get it?

I feel like a screen recording or two of using it to solve the concrete problem instances you use it for would be very helpful.

@ThePrimeagen
Copy link
Owner Author

@masaeedu as part of harpoon 2 rewrite, I'll be doing more documentation

@catgoose
Copy link

catgoose commented Dec 19, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests