Skip to content

Instantly share code, notes, and snippets.

@gaving
Created April 9, 2010 16:16
Show Gist options
  • Save gaving/361328 to your computer and use it in GitHub Desktop.
Save gaving/361328 to your computer and use it in GitHub Desktop.
if which pbpaste > /dev/null; then
# build git clone command from clipboard
git-clone-clipboard() {
REPO_URL="$(pbpaste)"
REPO_BASE_NAME=${$(basename $REPO_URL)%.git}
LBUFFER="nocorrect git clone $REPO_URL $REPO_BASE_NAME"
}
zle -N git-clone-clipboard
bindkey "^Xg" git-clone-clipboard
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment