Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Create a persistent directory stack in zsh' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create a persistent directory stack in zsh
Authored by: fxn on Aug 13, '05 05:11:12PM
I have this zsh function defined in ~/.zshrc
function go {
    case "$1" in
    "sim"  ) cd $HOME/isoco/prj/simweb/simma;;
    "hops" ) cd $HOME/isoco/prj/hops;;
    "cvs"  ) cd $HOME/isoco/prj/hops/cvs/isoco;;
    "web"  ) cd $HOME/hashref;;
    "src"  ) cd $HOME/src;;
    "tmp"  ) cd $HOME/tmp;;
    "ms"   ) cd $HOME/prj/metashop;;
    "halk" ) cd $HOME/prj/halk;;
    "lds"  ) cd $HOME/courses/lds-2004;;
    "ppx"  ) cd $HOME/courses/ppx-2004;;
    "wxp"  ) cd /Library/Python/2.3/sm/wxp;;
    *      ) echo Unknown alias $1;;
    esac
}
This provides aliases so that
    $ go halk
cds into the directory associated to "halk" no matter where you are.

[ Reply to This | # ]
Create a persistent directory stack in zsh
Authored by: wgscott on Aug 13, '05 08:27:21PM

You can do this with cd with the CDABLE_VARS option.



[ Reply to This | # ]
Create a persistent directory stack in zsh
Authored by: wgscott on Aug 13, '05 09:20:36PM

I re-read what you have, and I think what you want is to add /Users/$USER to your CDPATH



[ Reply to This | # ]