Skip to content

Instantly share code, notes, and snippets.

@hogashi
Last active May 13, 2020 08:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hogashi/8469463b4d78e11f97c4433aace604ae to your computer and use it in GitHub Desktop.
Save hogashi/8469463b4d78e11f97c4433aace604ae to your computer and use it in GitHub Desktop.
ghq look with peco shorthand in bash
## ghq look on ghq list
function glk() {
ARG_STR="$1"
PECO_RESULT=$(ghq list | peco --query "$ARG_STR")
PECO_RESULT=$(echo -n "${PECO_RESULT}" | tr -d '\n' | perl -pe 's/(^ | $)//g')
if [ ! -n "$PECO_RESULT" ]; then
return 1
fi
pushd "${GHQ_ROOT}/${PECO_RESULT}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment