Alas, I've found the packages 'Apparix' and 'Goto' which together make the stuff dreams are made of for us terminal junkies.
here: http://www.micans.org/apparix/
and here: http://sitaramc.googlepages.com/goto-considered-useful.html
Naturally, I had trouble installing Apparix, but I figured it out in the end.
How To Install Apparix on Mac OS X:
Steps:
1) Download the tarball from Apparix's homepage
2) Unpack the tarball, cd to the unpacked folder
3) Run this command ./configure --prefix=$HOME/local && make && make install
4) Now copy and paste the following into your ~/.bash_profile
################################
#
#
# Apparix
#
#
################################
export PATH=${PATH}:$HOME/local/bin
function to () {
if test "$2"; then
cd "$(apparix --try-current-first -favour rOl "$1" "$2" || echo .)"
elif test "$1"; then
if test "$1" == '-'; then
cd -
else
cd "$(apparix --try-current-first -favour rOl "$1" || echo .)"
fi
else
cd $HOME
fi
}
#optinally, "bm" can be changed to whatever you like, "bookmark" for instance.
function bm () {
if test "$2"; then
apparix --add-mark "$1" "$2";
elif test "$1"; then
apparix --add-mark "$1";
else
apparix --add-mark;
fi
}
function portal () {
if test "$1"; then
apparix --add-portal "$1";
else
apparix --add-portal;
fi
}
# function to generate list of completions from .apparixrc
function _apparix_aliases ()
{ cur=$2
dir=$3
COMPREPLY=()
nullglobsa=$(shopt -p nullglob)
shopt -s nullglob
if let $(($COMP_CWORD == 1)); then
# now cur=<apparix mark> (completing on this) and dir='to'
# Below will not complete on subdirectories. swap if so desired.
# COMPREPLY=( $( cat $HOME/.apparix{rc,expand} | grep "j,.*$cur.*," | cut -f2 -d, ) )
COMPREPLY=( $( (cat $HOME/.apparix{rc,expand} | grep "\<j," | cut -f2 -d, ; ls -1p | grep '/$' | tr -d /) | grep "\<$cur.*" ) )
else
# now dir=<apparix mark> and cur=<subdirectory-of-mark> (completing on this)
dir=`apparix --try-current-first -favour rOl $dir 2>/dev/null` || return 0
eval_compreply="COMPREPLY=( $(
cd "$dir"
\ls -d $cur* | while read r
do
[[ -d "$r" ]] &&
[[ $r == *$cur* ]] &&
echo \"${r// /\\ }\"
done
) )"
eval $eval_compreply
fi
$nullglobsa
return 0
}
# command to register the above to expand when the 'to' command's args are
# being expanded
complete -F _apparix_aliases to
################################
#
#
# End Apparix
#
#
################################
5) That's it. You should now have Apparix up and running on OS X (further install info and usage is on Apparix's homepage).