Created
June 5, 2014 08:50
-
-
Save sugyan/03af41390bbb2e2c09b0 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 percol_select_directory() { | |
local tac | |
if which tac > /dev/null; then | |
tac="tac" | |
else | |
tac="tail -r" | |
fi | |
local dest=$(_z -r 2>&1 | eval $tac | percol --query "$LBUFFER" | awk '{ print $2 }') | |
if [ -n "${dest}" ]; then | |
cd ${dest} | |
fi | |
zle reset-prompt | |
} | |
zle -N percol_select_directory | |
bindkey "^X^J" percol_select_directory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment