Last active
September 21, 2018 15:27
-
-
Save dohq/feef280b4c7b3534c38a4c4f65114a07 to your computer and use it in GitHub Desktop.
peco-ghq.zsh
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
#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