Last active
January 11, 2018 05:01
-
-
Save siriusjack/0b0032f22c72ffc7e5ba217f80674ad2 to your computer and use it in GitHub Desktop.
fzf-cdr integration
This file contains 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 fzf-cdr () { | |
local selected_dir=$(cdr -l | awk '{ print $2 }' | fzf --query "$LBUFFER") | |
if [ -n "$selected_dir" ]; then | |
BUFFER="cd ${selected_dir}" | |
zle accept-line | |
fi | |
zle clear-screen | |
} | |
zle -N fzf-cdr | |
bindkey "^x^b" fzf-cdr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment