This plugin is greatly inspired by zsh-better-npm-completion. It works the same way, as you can see with npm demo:
- Makes
yarn addrecommendations from npm cache, - Makes
yarn removerecommendations fromdependencies/devDependencies, - Shows detailed information on script contents for
npm run, - Calls already installed yarn completion for any other command.
You'll need jq.
It is strongly suggested that you also have the default yarn suggestion under
the name of _yarn. Or that you set YARN_EXTRA_COMPLETION_DEFAULT=_your_default_function.
Using Antigen
Bundle zsh-better-npm-completion in your .zshrc
antigen bundle buonomo/yarn-extra-completionUsing zplug
Load zsh-better-npm-completion as a plugin in your .zshrc
zplug "buonomo/yarn-extra-completion", defer:2
Using zgen
Include the load command in your .zshrc
zgen load buonomo/yarn-extra-completionAs an Oh My ZSH! custom plugin
Clone yarn-extra-completion into your custom plugins repo
git clone https://github.com/buonomo/yarn-extra-completion ~/.oh-my-zsh/custom/plugins/yarn-extra-completionThen load as a plugin in your .zshrc
plugins+=(yarn-extra-completion)Clone this repository somewhere (~/.yarn-extra-completion for example)
git clone https://github.com/buonomo/yarn-extra-completion.git ~/.yarn-extra-completionThen source it in your .zshrc
source ~/.yarn-extra-completion/yarn-extra-completion.plugin.zshMIT © Ulysse Buonomo