rapgenic / zsh-git-complete-urls

Zsh plugin to enhance git completion to include in the remotes completion (e.g. from `git clone`) any URL in the clipboard

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zsh-git-complete-urls

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

License:GNU General Public License v3.0


Languages

Language:Shell 100.0%