Hacker News new | ask | show | jobs
by sjs 5594 days ago
Or in zsh:

    setopt cdablevars
    nm=/path/to/whatever
    cd nm
2 comments

you can put this in ~/.zshrc for persistent zsh bookmarks

  touch ~/.zshmarks && source ~/.zshmarks
  function b() {
    echo "hash -d $1=\"`pwd`\"" >> ~/.zshmarks && source ~/.zshmarks
  }
or you could just put some paths on your cdpath and enable autocd.
and then you just cd by typing ~bookmark
in Bash, change the first line to:

    shopt -s cdable_vars
in Bash you don't even need to do that, just do:

    foo=/etc/
    cd $foo