Skip to content

Instantly share code, notes, and snippets.

@hirofumi
Created November 24, 2016 16:39
Show Gist options
  • Save hirofumi/46258c8f4155d4c885b8fd1e82df5447 to your computer and use it in GitHub Desktop.
Save hirofumi/46258c8f4155d4c885b8fd1e82df5447 to your computer and use it in GitHub Desktop.
ghq + peco + cd
function repo() {
local selected
selected=$(ghq list --full-path | grep "$1" | peco --query="$1" --select-1)
test -n "${selected}" && cd "${selected}"
}
function _repo() {
_values $(ghq list --unique)
}
compdef _repo repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment