Skip to content

Instantly share code, notes, and snippets.

@y16ra
Created July 31, 2024 01:08
Show Gist options
  • Save y16ra/72c318a6dc4af33543293854d229c01f to your computer and use it in GitHub Desktop.
Save y16ra/72c318a6dc4af33543293854d229c01f to your computer and use it in GitHub Desktop.
navigates to the directory of a repository listed by the `ghq` command using `fzf`.
function fzf-src(){
local src=$(ghq list --full-path | fzf --query "$LBUFFER" --layout=reverse)
if [ -n "$src" ]; then
BUFFER="cd $src"
zle accept-line
fi
zle -R -c
}
zle -N fzf-src
bindkey '^]' fzf-src
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment