diff options
-rw-r--r-- | .zshrc | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -297,6 +297,16 @@ SPROMPT='zsh: correct '%R' to '%r' ? ([Y]es/[N]o/[E]dit/[A]bort) ' # }}} # Functions {{{ +function cd () { + if (( ${#argv} == 1 )) && [[ -f ${1} ]]; then + [[ ! -e ${1:h} ]] && return 1 + print "Correcting ${1} to ${1:h}" + builtin cd ${1:h} + else + builtin cd "$@" + fi +} + sv() { vim "sudo:$1" } |