You may also like:
- pnpm-shell-completion - Same as this tool, but for pnpm.
- icd - Powerful
cdcommand with fuzzy-search tool.
- yarn run
- yarn remove
- yarn add
- yarn why
You can customize the autocompletion of yarn add command.
It's configurable.
Please go to the GitHub releases page and download the latest binary files.
Note that you should choose correct file according to your OS.
Unzip the compressed file you downloaded.
For 1.x (or above) users, please run:
$ ./install.sh $ZSH_CUSTOM/pluginsFor 0.2 users, please run:
$ ./install.sh $ZSH_CUSTOMNext please edit your .zshrc file.
Add yarn-autocompletions to plugins section.
Like this:
plugins=(
# ... your other plugins
+ yarn-autocompletions
)Restart your terminal.
Fig adds apps, shortcuts, and autocomplete to your existing terminal.
Install zsh-yarn-autocompletions in just one click.
Update your .zshrc file with the following line:
zinit ice atload"zpcdreplay" atclone'./zplug.zsh'
zinit light g-plane/zsh-yarn-autocompletionsUpdate your .zshrc file with the following line:
zplug "g-plane/zsh-yarn-autocompletions", hook-build:"./zplug.zsh", defer:2Since v1.0.0
This plugin support adding your favorite packages name for autocompletion
of yarn add and yarn add --dev command.
First, put a new file called .yarn-autocompletions.yml in your home directory.
For example:
$ touch ~/.yarn-autocompletions.ymlThis file is in YAML format.
We assume you want to add vue and react.
So you can edit that file like this:
dependencies:
- vue
- reactAnd dev_dependencies:
dev_dependencies:
- vue-loader
- parcel-bundlerIn fact, this plugin has some builtin packages autocompletion
which can provide out-of-the-box experience, such as vue or react.
However you don't like those builtin packages.
So you can add it to exclude section:
exclude:
- reactNow you won't see react in autocompletion.
Now the whole configuration file looks like:
dependencies:
- vue
- react
dev_dependencies:
- vue-loader
- parcel-bundler
exclude:
- reactKeep in mind that any sections are optional.
Make sure that you've installed rustup first and use rustup to install Rust.
Next, follow the steps below:
git clone https://github.com/g-plane/zsh-yarn-autocompletions.git
cd zsh-yarn-autocompletions
cargo build --release
mkdir -p $ZSH_CUSTOM/plugins/yarn-autocompletions
cp ./yarn-autocompletions.plugin.zsh $ZSH_CUSTOM/plugins/yarn-autocompletions/
cp ./target/release/yarn-autocompletions $ZSH_CUSTOM/plugins/yarn-autocompletions/
Then, edit your .zshrc like this:
plugins=(
# ... your other plugins
+ yarn-autocompletions
)Restart your terminal.
Any contributions are welcome.
MIT License
Copyright (c) 2018-present Pig Fang
