I've been relying on this hack for jumping around in the file system for a couple of years before finding out today that I can do the same thing using native Bash by activating the option cdable_vars
.
The only thing I miss is tab completion. If I put this in my .bashrc
or .bash_profile
:
shopt -s cdable_vars
export mydir="$HOME/my/nested/directory"
Tab completion isn't expanding mydir
when I try to cd
into it from the prompt. Is there a way to activate this behavior in Bash?