Created
September 5, 2014 20:49
-
-
Save syui/43697ba219a0567fa9ae to your computer and use it in GitHub Desktop.
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
function cdup_dir() { | |
if [[ -z "$BUFFER" ]]; then | |
echo | |
cd .. | |
ls -aF | |
zle reset-prompt | |
else | |
zle self-insert 'k' | |
fi | |
} | |
zle -N cdup_dir | |
bindkey '^k' cdup_dir | |
function cddown_dir(){ | |
com='zsh -c "ls -AF . | grep / "' | |
while [ $? = 0 ] | |
do | |
cdir=`eval $com | peco` | |
if [ $? = 0 ];then | |
cd $cdir | |
eval $com | |
else | |
break | |
fi | |
done | |
zle reset-prompt | |
} | |
zle -N cddown_dir | |
bindkey '^j' cddown_dir | |
#bindkey '^j^j' zaw-cdr | |
#bindkey '^j^k' zaw-z |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment