Home

Awesome

zinit-annex-unscope

NOTE: Due to security concerns, we advise using fully-qualified plugin names. See this issue for more context.

A Zinit-Zsh annex that allows users to install plugins without specifying the GitHub user name. It works as follows:

  1. On the installation of a plugin without any slashes (/) in its name the annex will query the GitHub API searching for */{the-name}, sorting on stars.

  2. It first requires at least 10 forks on the candidates, then 2, then 0.

  3. After finding the best result it sets it as the full remote-id of the plugin, storing the ID on disk for later automatic use.

  4. For security, for such GH-API request to be made a newly added (by this annex) ice: ghapi is required to be given.

  5. Otherwise only the static database of mappings of short-plugin nicknames to the full scoped IDs will be searched. It contains many mappings, like, e.g.: vi-regzsh-vi-more/evil-registers, and also the usual basic unscopings of some of the popular plugins out there, like, e.g.: zsh-syntax-highlightingzsh-users/zsh-syntax-highlighting and more.

Usage Examples

  1. An example installation via 2 nicknames (env and vi-reg) and by one unscoped (i.e.: not using any GitHub username) ID that's being dynamically resolved by a request to GitHub API:

zinit-for-command

  1. An example call to the zinit scope … subcommand that is added by this annex. It allows to translate the unscoped IDs and the short-static nicknames into the full username/repository plugin ID.

scope-subcommand

Static Mappings

Besides the GitHub-API querying, there's also a fixed, curated list of mappings of short names to the full GitHub IDs. The list currently consists of:

Short (Nick-) NameGitHub ID / scoped ID
nullzdharma-continuum/null
zinit-annex-as-monitorzdharma-continuum/zinit-annex-as-monitor
as-monitorzdharma-continuum/zinit-annex-as-monitor
monitorzdharma-continuum/zinit-annex-as-monitor
zinit-annex-patch-dlzdharma-continuum/zinit-annex-patch-dl
patch-dlzdharma-continuum/zinit-annex-patch-dl
zinit-annex-submodszdharma-continuum/zinit-annex-submods
submodszdharma-continuum/zinit-annex-submods
zinit-annex-rustzdharma-continuum/zinit-annex-rust
rustzdharma-continuum/zinit-annex-rust
zinit-annex-bin-gem-nodezdharma-continuum/zinit-annex-bin-gem-node
bin-gem-nodezdharma-continuum/zinit-annex-bin-gem-node
bgnzdharma-continuum/zinit-annex-bin-gem-node
zinit-consolezdharma-continuum/zinit-console
consolezdharma-continuum/zinit-console
consolettezdharma-continuum/zinit-console
archivePZTM::archive
archPZTM::archive
directoryPZTM::directory
dirPZTM::directory
environmentPZTM::environment
envPZTM::environment
utilityPZTM::utility
utilPZTM::utility
fast-syntax-highlightingzdharma-continuum/fast-syntax-highlighting
f-sy-hzdharma-continuum/fast-syntax-highlighting
fshzdharma-continuum/fast-syntax-highlighting
history-search-multi-wordzdharma-continuum/history-search-multi-word
hsmwzdharma-continuum/history-search-multi-word
zuizdharma-continuum/zui
ZUIzdharma-continuum/zui
zconveyzdharma-continuum/zconvey
zconvzdharma-continuum/zconvey
zbrowsezdharma-continuum/zbrowse
zzcompletezdharma-continuum/zzcomplete
zzcompzdharma-continuum/zzcomplete
zzcomzdharma-continuum/zzcomplete
zsh-autosuggestionszsh-users/zsh-autosuggestions
autosuggestionszsh-users/zsh-autosuggestions
autosugzsh-users/zsh-autosuggestions
asugzsh-users/zsh-autosuggestions
z-asugzsh-users/zsh-autosuggestions
zsh-syntax-highlightingzsh-users/zsh-syntax-highlighting
z-sy-hzsh-users/zsh-syntax-highlighting
zsh-autocompletemarlonrichert/zsh-autocomplete
autocompletemarlonrichert/zsh-autocomplete
autocompmarlonrichert/zsh-autocomplete
aucommarlonrichert/zsh-autocomplete
acommarlonrichert/zsh-autocomplete
z-aucommarlonrichert/zsh-autocomplete
z-acommarlonrichert/zsh-autocomplete
zsh-autopairhlissner/zsh-autopair
autopairhlissner/zsh-autopair
aupairhlissner/zsh-autopair
aupahlissner/zsh-autopair
z-aupahlissner/zsh-autopair
evil-registerszsh-vi-more/evil-registers
evil-regzsh-vi-more/evil-registers
vi-regzsh-vi-more/evil-registers
viregzsh-vi-more/evil-registers
vi-motionszsh-vi-more/vi-motions
evil-motzsh-vi-more/vi-motions
vi-motzsh-vi-more/vi-motions
vimotzsh-vi-more/vi-motions
vi-incrementzsh-vi-more/vi-increment
evil-inczsh-vi-more/vi-increment
vi-inczsh-vi-more/vi-increment
viinczsh-vi-more/vi-increment
vi-quotezsh-vi-more/vi-quote
evil-qtezsh-vi-more/vi-quote
vi-qtezsh-vi-more/vi-quote
viqtezsh-vi-more/vi-quote
directory-markszsh-vi-more/directory-marks
evil-dir-markszsh-vi-more/directory-marks
vi-dir-markszsh-vi-more/directory-marks
vi-dirmazsh-vi-more/directory-marks
vidirmazsh-vi-more/directory-marks
fdsharkdp/fd
shark-fdsharkdp/fd
batsharkdp/bat
shark-batsharkdp/bat
exaogham/exa
zsh-completionszsh-users/zsh-completions
completionszsh-users/zsh-completions
compszsh-users/zsh-completions

You can let me know if you would like a name to be added to the list.

Installation

Simply load as a regular plugin, i.e.:

zinit light-mode for zdharma-continuum/zinit-annex-unscope

It should be done possibly early in the zshrc, as otherwise the preceding zinit calls will not have the unscoped IDs resolved.

<!-- vim:set ft=markdown tw=79 autoindent fo+=a1n: -->