GithubHelp home page GithubHelp logo

mrlexipoo / zsh-yarn-autocompletions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from g-plane/zsh-yarn-autocompletions

0.0 1.0 0.0 137 KB

A Zsh plugin for yarn autocompletions.

License: MIT License

Shell 15.71% Rust 84.29%

zsh-yarn-autocompletions's Introduction

zsh-yarn-autocompletions

Travis license Github Releases

Supported yarn commands

  • yarn run
  • yarn remove
  • yarn add

You can customize the autocompletion of yarn add command. It's configurable.

Installation

Manually

Download

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 .zshrc file. Add yarn-autocompletions to plugins section.

Like this:

plugins=(
  # ... your other plugins
+ yarn-autocompletions
)

Restart your terminal.

With a plugin manager

Update your .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

Since v1.0.0

This plugin support adding your favorite packages name for autocompletion of yarn add and yarn add --dev command.

Adding a configuration file

First, put a new file called .yarn-autocompletions.yml in your home directory.

For example:

$ touch ~/.yarn-autocompletions.yml

This file is in YAML format.

Adding your favorite packages

We assume you want to add vue and react. So you can edit that file like this:

dependencies:
  - vue
  - react

And dev_dependencies:

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 vue or react.

However you don't like those builtin packages.

So you can add it to exclude section:

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.

Contribution

Any contributions are welcome.

License

MIT License

Copyright (c) 2018-present Pig Fang

zsh-yarn-autocompletions's People

Contributors

g-plane avatar danielbayerlein avatar arthurdenner avatar josh- avatar azure-pipelines[bot] avatar

Watchers

Alexis Emilio Carranza Luna avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.