You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zsh plugin to enhance git completion to include in the remotes completion (e.g. from git clone) any URL in the clipboard
Installation
Just source zsh-git-complete-urls.plugin.zsh in your .zshrc.
The clipboard plugin (included for example in oh-my-zsh or available at zsh-clipboard as a single plugin) must be installed for zsh-git-complete-urls to work
Add the following line to your .zshrc:
zplug
zplug "rapgenic/zsh-git-complete-urls"
antigen
antigen bundle rapgenic/zsh-git-complete-urls
antibody
antibody bundle rapgenic/zsh-git-complete-urls
zgen
zgen load rapgenic/zsh-git-complete-urls
How does it work??
It just overrides one of the simplest functions in the default git zsh completion library, __git_any_repositories, which gives the suggestions for the repos, and by adding a single argument to the _alternative function:
'remote-clipboard::__git_remote_clipboard'
where __git_remote_clipboard is another function defined in the plugin file that gives back an url suggestion from the clipboard, that is then added to the list of suggestions returned.
About
Zsh plugin to enhance git completion to include in the remotes completion (e.g. from `git clone`) any URL in the clipboard