Skip to content

Instantly share code, notes, and snippets.

@syui
Created September 5, 2014 20:49
Show Gist options
  • Save syui/43697ba219a0567fa9ae to your computer and use it in GitHub Desktop.
Save syui/43697ba219a0567fa9ae to your computer and use it in GitHub Desktop.
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