diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index 16fc1e1..f847920 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -60,6 +60,14 @@ mkcd() { mkdir $1 && cd $1 } +# which && cd +cdw() { + f=`which $1` + if [ $? -eq 0 ]; then + cd `dirname $f` + fi +} + # Initialize thefuck command -v thefuck > /dev/null 2>&1