Skip to content

Instantly share code, notes, and snippets.

@dohq
Last active September 21, 2018 15:27
Show Gist options
  • Save dohq/feef280b4c7b3534c38a4c4f65114a07 to your computer and use it in GitHub Desktop.
Save dohq/feef280b4c7b3534c38a4c4f65114a07 to your computer and use it in GitHub Desktop.
peco-ghq.zsh
#bindkey '^g' list ghq src
function peco-ghq () {
local selected_dir=$(ghq list -p | peco --query "$LBUFFER")
if [ -n "$selected_dir" ]; then
BUFFER="cd ${selected_dir}"
zle accept-line
fi
zle clear-screen
}
zle -N peco-ghq
bindkey '^g' peco-ghq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment