Skip to content

Instantly share code, notes, and snippets.

@kentaro
Created March 24, 2012 13:07
Show Gist options
  • Save kentaro/2182582 to your computer and use it in GitHub Desktop.
Save kentaro/2182582 to your computer and use it in GitHub Desktop.
cdd.zsh
#
# zaw-src-cdd
#
# zaw source for cdd command
#
(( $+functions[cdd] )) || return
function zaw-src-cdd () {
if [ -r "$CDD_PWD_FILE" ]; then
for window in `cat $CDD_PWD_FILE | sed '/^$/d'`; do
candidates+=("${window}")
done
actions=(zaw-src-cdd-cd)
act_descriptions=("cdd for zaw")
fi
}
function zaw-src-cdd-cd () {
BUFFER="cd `echo $1 | cut -d ':' -f 2`"
zle accept-line
}
zaw-register-src -n cdd zaw-src-cdd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment