Harpoon package for emacs, based on the plugin from ThePrimeagen.
This package offers quick bookmarks separated by project and branch. You can quick navigate between your working files and forget about that files opened that you will not use anymore.
Harpoon is more a way to manage and quick navigate between the main files that you are working on than a bookmark system.
Load harpoon.el
in your personal configuration.
M-x package-install harpoon
Add to package.el:
(package! harpoon)
- Add, order and delete harpoons in your code.
- Harpoon is separated by project and branch
- Quick switch between harpoons
Example of how to set the shortcuts:
;; On vanilla (You can use another prefix instead C-c h)
;; You can use this hydra menu that have all the commands
(global-set-key (kbd "C-c a") 'harpoon-quick-menu-hydra)
(global-set-key (kbd "C-c h <return>") 'harpoon-add-file)
;; And the vanilla commands
(global-set-key (kbd "C-c h f") 'harpoon-toggle-file)
(global-set-key (kbd "C-c h h") 'harpoon-toggle-quick-menu)
(global-set-key (kbd "C-c h c") 'harpoon-clear)
(global-set-key (kbd "C-c h 1") 'harpoon-go-to-1)
(global-set-key (kbd "C-c h 2") 'harpoon-go-to-2)
(global-set-key (kbd "C-c h 3") 'harpoon-go-to-3)
(global-set-key (kbd "C-c h 4") 'harpoon-go-to-4)
(global-set-key (kbd "C-c h 5") 'harpoon-go-to-5)
(global-set-key (kbd "C-c h 6") 'harpoon-go-to-6)
(global-set-key (kbd "C-c h 7") 'harpoon-go-to-7)
(global-set-key (kbd "C-c h 8") 'harpoon-go-to-8)
(global-set-key (kbd "C-c h 9") 'harpoon-go-to-9)
;; On doom emacs
;; You can use this hydra menu that have all the commands
(map! :n "C-SPC" 'harpoon-quick-menu-hydra)
(map! :n "C-s" 'harpoon-add-file)
;; And the vanilla commands
(map! :leader "j c" 'harpoon-clear)
(map! :leader "j f" 'harpoon-toggle-file)
(map! :leader "1" 'harpoon-go-to-1)
(map! :leader "2" 'harpoon-go-to-2)
(map! :leader "3" 'harpoon-go-to-3)
(map! :leader "4" 'harpoon-go-to-4)
(map! :leader "5" 'harpoon-go-to-5)
(map! :leader "6" 'harpoon-go-to-6)
(map! :leader "7" 'harpoon-go-to-7)
(map! :leader "8" 'harpoon-go-to-8)
(map! :leader "9" 'harpoon-go-to-9)
You can customize by setting this variable:
Variable | Description | Default |
harpoon-separate-by-branch | If nil, ignores the branch | t |
harpoon-project-package | Package used to harpoon to get project stuff. Available: projectile, project | ‘projectile |
harpoon-without-project-function | Function used to return a name for harpoon cache file when not visiting a project. | ‘harpoon–package-name |
If you want that harpoon behaves uses the current file directory, change it to ‘harpoon–current-file-directory
If you use doom , you can set this variable to ‘+workspace-current-name and use the workspace name instead the harpoon global.
You can also create your own function to determine the harpoon cache file and add to this variable.
https://github.com/otavioschwanck/rails-i18n.el
https://github.com/otavioschwanck/rails-routes.el
(Very complete, has videos + handbooks of how to use) https://github.com/otavioschwanck/doom-emacs-on-rails/