Supported yarn commands
- yarn run
- yarn remove
- yarn add
You can customize the autocompletion of
yarn add command.
Please go to the GitHub releases page and download the latest binary files.
Note that you should choose correct file according to your OS.
Add as a Zsh plugin
Unzip the compressed file you downloaded.
For 1.x users, please run:
$ ./install.sh $ZSH_CUSTOM/plugins
For 0.2 users, please run:
$ ./install.sh $ZSH_CUSTOM
Next please edit your
plugins=( # ... your other plugins + yarn-autocompletions )
Restart your terminal.
With a plugin manager
.zshrc file with the following line:
zplug "g-plane/zsh-yarn-autocompletions", hook-build:"./zplug.zsh", defer:2
Customize the autocompletion of
yarn add command
This plugin support adding your favorite packages name for autocompletion
yarn add and
yarn add --dev command.
Adding a configuration file
First, put a new file called
.yarn-autocompletions.yml in your home directory.
$ touch ~/.yarn-autocompletions.yml
This file is in YAML format.
Adding your favorite packages
We assume you want to add
So you can edit that file like this:
dependencies: - vue - react
dev_dependencies: - vue-loader - parcel-bundler
Excluding some packages
In fact, this plugin has some builtin packages autocompletion
which can provide out-of-the-box experience, such as
However you don't like those builtin packages.
So you can add it to
exclude: - react
Now you won't see
react in autocompletion.
All sections are optional
Now the whole configuration file looks like:
dependencies: - vue - react dev_dependencies: - vue-loader - parcel-bundler exclude: - react
Keep in mind that any sections are optional.
Any contributions are welcome.
Copyright (c) 2018-present Pig Fang