Skip to content

Instantly share code, notes, and snippets.

@siriusjack
Last active January 11, 2018 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save siriusjack/0b0032f22c72ffc7e5ba217f80674ad2 to your computer and use it in GitHub Desktop.
Save siriusjack/0b0032f22c72ffc7e5ba217f80674ad2 to your computer and use it in GitHub Desktop.
fzf-cdr integration
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