Skip to content

Instantly share code, notes, and snippets.

@dasgib
Created Dec 20, 2011
Embed
What would you like to do?
pathed_cd for zsh - start new shell in last used directory
pathed_cd () {
if [ x"$1" = x ]; then
cd
else
cd "$1"
fi
pwd > ~/.cdpath
}
alias cd="pathed_cd"
if [ -f ~/.cdpath ]; then
cd $(cat ~/.cdpath)
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment