HyperJump - simple and quick bookmark tool for bash and zsh shells. I found similar projects, but nothing that was both fast, easy to use, and simple enough. I really needed a location bookmarking app because I am working on a high latency connection, and switching between directories is a pain. It's also a nice memory aid. I installed it on all of the servers I manage, and now I can run something like jj httpd
and jump to the right config directory for the web server on that machine, regardless of the operating system it's running. So it's basically a tool to reduce your cognitive load.
HyperJump consists of 3 command line commands (functions).
- jr - Jump Remember. Bookmarks current directory. Run
jr nickname
to add current directory, or just runjr
and use the interactive mode. - jf - Jump Forget. Deletes the current directory from the bookmarks. Run
jf
while in a directory you want forgotten orjf nickname
to forget a specific nickname. - jj - Jump Jump. Jumps to a bookmark location. Run
jj nickname
to jump to a location or justjj
to get a list of all bookmarks. You can also runjj nickname command
to jump to a location and than run the command specified with "./" as the first argument. So, for instance, you can runjj myProject open subl
on OSX to jump to the myProject directory and open the myProject directory in Finder and Sublime Text. - jp - Jump Push. Jumps to a bookmark location and saves that location to the directory stack. Usage is like
jj
but usespushd
instead ofcd
. - hjsort - Sort the hyperjump list (Note that running a "jr" will also sort the list)
All of the commands have autocomplete. jj, jp, and jf will autocomplete with nicknames of bookmarked locations. The jr command will autocomplete with the basename of the current directory. After the first argument, jj and jp will autocomplete with list of available system commands (programs).
Examples:
# Remember current directory
$ jr
$ jr MyDir
# Forget current directory
$ jf
# Forget another directory
$ jf AnotherDir
# Jump to a directory
$ jj
$ jj MyDir
# Jump to a directory and push to dirs
$ jp
$ jp MyDir
# Jump to a directory and open the directory in another program(s)
$ jj MyDir open
$ jj MyDir open subl tm
$ jp MyDir open
# Sort the list of bookmarks (not normally necessary as running jr sorts the list)
$ hjsort
Download hyperjump bash script and place it somewhere on your system, such as ~/bin/hyperjump
. Add the following line to your .profile, .bashrc or .zshrc file:
source /location/of/hyperjump
Optional: To get the list of all the Bookmarks in a nice looking menu window, you need a unix utility called dialog. You can install it via yum, apt-get, homebrew, ports, and others like so:
sudo yum install dialog
sudo apt-get install dialog
brew install dialog
sudo port install dialog
Released under the MIT License. Use it, love it, fork it, make changes, send pull requests. Enjoy!