Created
March 24, 2012 13:07
-
-
Save kentaro/2182582 to your computer and use it in GitHub Desktop.
cdd.zsh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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