Skip to content

Instantly share code, notes, and snippets.

@siriusjack
Created December 31, 2017 19:05
Show Gist options
  • Save siriusjack/b1efe42572c720227bf45021c2d486cd to your computer and use it in GitHub Desktop.
Save siriusjack/b1efe42572c720227bf45021c2d486cd to your computer and use it in GitHub Desktop.
fzf-ghq integration for zsh
function ghq-fzf() {
local selected_dir=$(ghq list --full-path | fzf --query="$LBUFFER")
if [ -n "$selected_dir" ]; then
BUFFER="cd ${selected_dir}"
zle accept-line
fi
zle reset-prompt
}
zle -N ghq-fzf
bindkey "^g" ghq-fzf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment