% pwd
/home/aram
% cd mstate
/home/aram/src/launchpad.net/juju-core/mstate
% cd go/src
/home/aram/go/src
% cd plan9
/home/aram/plan9
%
It uses the $CDPATH environment variable ($cdpath in rc(1)). $CDPATH is a list of places in which to search for the wanted directory. I put all the things I regularly use there, and my cds are almost always short, usually just a single name.I don't maintain $CDPATH myself, my profile runs a one liner that descends into certain directories and constructs $CDPATH for me within the constrains of some rules (for example excludes leafs, excludes {bin,doc,pkg,test}, etc).
Finding about $CDPATH was a huge productivity boost to me, not only in time saved typing, but in allowing me to change the way I work. I now rarely care where things in the filesystem are (e.g. various source code for various software, where the build products are, etc). I used to do a lot of moving and symlinking around, to arrange stuff so I remember where I've put it and to keep paths short, but now I don't care. It could be wherever, it's just one name away. The namespace had become a big hash.