Created
December 31, 2017 19:05
-
-
Save siriusjack/b1efe42572c720227bf45021c2d486cd to your computer and use it in GitHub Desktop.
fzf-ghq integration for 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
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