Skip to content

Instantly share code, notes, and snippets.

@tsub
Last active June 8, 2021 03:28
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tsub/4448666a276b088bce3f19005f512c15 to your computer and use it in GitHub Desktop.
Save tsub/4448666a276b088bce3f19005f512c15 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 "^]" ghq-fzf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment