reddit / emacs

New Plugin: Harpoon

otavioschwanck · 2022-01-25 02:04
Bookmarks separated by project and branch for quick navigate between your working files! [https://github.com/otavioschwanck/harpoon.el](https://github.com/otavioschwanck/harpoon.el)
dnquark · 2022-01-25 06:31
I just tried installing it using `(package! harpoon)` in doom emacs, but doom sync errored out: `(error "Could not find package harpoon. Updating recipe repositories: (org-elpa melpa gnu-elpa-mirror el-get emacsmirror-mirror) with ‘straight-pull-recipe-repositories’ may fix this")` :(
flyin1501 · 2022-01-25 06:56
> Updating recipe repositories: (org-elpa melpa gnu-elpa-mirror el-get emacsmirror-mirror) with ‘straight-pull-recipe-repositories’ may fix this") This happens because the local MELPA repository is out of date. Doing `M-x straight-pull-recipe-repositories RET` will update, after which `doom sync` should work.
7890yuiop · 2022-01-25 11:12
> Bookmarks separated by project and branch for quick navigate between your working files! This description is disappointingly devoid of naval wargames.
github-alphapapa · 2022-01-25 22:27
This is a nice idea, but it would seem to reimplement functionality already provided by Emacs's own bookmarks system. An Emacs bookmark record is extensible, so you can add any number of your own fields (tags, project, etc) to one. Then you can use existing bookmarks commands and libraries to operate on them. For example, see the `dogears` package and how it uses the `bookmarks` library as a backend.
[deleted] · 2022-01-26 04:41
[deleted]
LemonBreezes · 2022-01-26 08:07
Thank you. I just started using `bookmark+` after reading this. Now I'm using tags to filter my bookmarks. My use-case currently is replacing my browser's bookmarks.
otavioschwanck · 2022-01-26 20:48
This project is more like a quick bookmark, temporary then a real bookmark. Normally we work around 3, 4 files max and the rest of buffers are only used to search / copy some codes. It gets polluted after some time. With harpoon, you just marks those 4 files and quick navigate between then without worrying with the rest. When your task done and you switch branch, the bookmarks are gone! Other thing: Harpoon doesn't care about the line. Most of the times, you the line you marked is not where you need to be. Most of the times you want to be in the last place you has before switching, so, harpoon takes care of it But anyways, ill take a look on this bookmark feature of emacs
github-alphapapa · 2022-01-27 02:56
Very well, but you could still easily use the Emacs bookmarks system for that. All you would need to do is to make your Harpoon bookmarks unique (e.g. by adding an alist key, or putting "Harpoon" in the bookmark name), and then you could easily write a couple of functions to select from Harpoon bookmarks and to delete outdated ones. This would save you from all the code you have regarding cache files, etc, that reimplements what the built-in bookmark library already does. See, e.g. how `dogears`'s bookmarks are distinguished in their records.
otavioschwanck · 2022-01-27 03:39
One killer feature of harpoon is edit the bookmarks as a file, to re-order and easily remove. The most important part is switch with prefix + 1 to 9. Emacs bookmarks support thats? If yes, i'll refact when have some time.
github-alphapapa · 2022-01-28 21:12
Rather than continue to answer, "Can Emacs's built-in bookmarks do this? What about that?" I'll suggest that you explore its functionality, documentation, code, and related third-party packages. Suffice to say that reinventing the wheel as Harpoon does is unnecessary. Study `bookmark-alist` and you will be enlightened. ;)