Skip to content

Instantly share code, notes, and snippets.

@lapis-zero09
Last active October 29, 2017 10:58
Show Gist options
  • Save lapis-zero09/5b202bbff8f15826ff2cc9e2d36a6efa to your computer and use it in GitHub Desktop.
Save lapis-zero09/5b202bbff8f15826ff2cc9e2d36a6efa to your computer and use it in GitHub Desktop.
function ghq-fzf() {
local selected_dir=$(ghq list | fzf --query="$LBUFFER")
if [ -n "$selected_dir" ]; then
BUFFER="cd $(ghq root)/${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