How often do you find yourself typing the same
cd commands to the same directories over and over?
This tool lets you save bookmarks for your frequently-used directories, and jump quickly back to them - even if they were defined relative to an environment variable.
alias jj='cd $(jj.py)' # choose a path to jump to alias jjk='jj.py k' # store the current path
If you're on Cygwin, use this
jj alias instead:
alias jj='cd $(cygpath -w -m $(jj.py))'
It remembers the most recent 16 paths stored.
Simple, but with a nifty twist:
Suppose you have an (exported) variable
FOO=/path/to, and you're in
/path/to/your/directory. Sometimes, you might want to save the literal path, but perhaps other times you're actually interested in
$FOO/your/directory - so that later, when
$FOO is different, the bookmark refers to the current
Jump Jump is smart:
~/foo/bar/baz $ export AAA=$HOME/foo ~/foo/bar/baz $ export BBB=$HOME/foo/bar ~/foo/bar/baz $ jjk Store: a) /home/dmd/foo/bar/baz b) $BBB/baz c) $AAA/bar/baz
Note that it gave me several choices; the literal path, and two paths based on environment variables it found (in decreasing greediness).