diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/aws/aws.plugin.zsh | 4 | ||||
-rw-r--r-- | plugins/battery/README.md | 11 | ||||
-rw-r--r-- | plugins/docker-compose/README.md | 1 | ||||
-rw-r--r-- | plugins/docker-compose/docker-compose.plugin.zsh | 1 | ||||
-rw-r--r-- | plugins/dotenv/README.md | 24 | ||||
-rw-r--r-- | plugins/dotenv/dotenv.plugin.zsh | 12 | ||||
-rw-r--r-- | plugins/extract/README.md | 1 | ||||
-rw-r--r-- | plugins/extract/_extract | 2 | ||||
-rw-r--r-- | plugins/extract/extract.plugin.zsh | 2 | ||||
-rw-r--r-- | plugins/httpie/README.md | 6 | ||||
-rw-r--r-- | plugins/httpie/httpie.plugin.zsh | 7 | ||||
-rw-r--r-- | plugins/kubectl/README.md | 3 | ||||
-rw-r--r-- | plugins/kubectl/kubectl.plugin.zsh | 3 | ||||
-rw-r--r-- | plugins/mix-fast/mix-fast.plugin.zsh | 5 | ||||
-rw-r--r-- | plugins/sudo/sudo.plugin.zsh | 29 | ||||
-rw-r--r-- | plugins/timer/README.md | 1 | ||||
-rw-r--r-- | plugins/timer/timer.plugin.zsh | 8 | ||||
-rw-r--r-- | plugins/vscode/README.md | 32 | ||||
-rw-r--r-- | plugins/vscode/vscode.plugin.zsh | 27 | ||||
-rw-r--r-- | plugins/yarn/README.md | 65 | ||||
-rw-r--r-- | plugins/yarn/yarn.plugin.zsh | 1 |
21 files changed, 166 insertions, 79 deletions
diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 4b5446407..7994963c3 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -41,7 +41,7 @@ function aws_change_access_key() { function aws_profiles() { [[ -r "${AWS_CONFIG_FILE:-$HOME/.aws/config}" ]] || return 1 - grep '\[profile' "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/' + grep '\[profile' "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9@_\.-]*\).*/\1/' } function _aws_profiles() { @@ -63,7 +63,7 @@ fi # Load awscli completions # AWS CLI v2 comes with its own autocompletion. Check if that is there, otherwise fall back -if [[ -x /usr/local/bin/aws_completer ]]; then +if command -v aws_completer &> /dev/null; then autoload -Uz bashcompinit && bashcompinit complete -C aws_completer aws else diff --git a/plugins/battery/README.md b/plugins/battery/README.md index b7a13a7ec..c2554a36d 100644 --- a/plugins/battery/README.md +++ b/plugins/battery/README.md @@ -9,5 +9,14 @@ To use, add `battery` to the list of plugins in your `.zshrc` file: Then, add the `battery_pct_prompt` function to your custom theme. For example: ``` -RPROMPT='$(battery_pct_prompt)' +RPROMPT='$(battery_pct_prompt) ...' +``` + +## Requirements + +On Linux, you must have the `acpi` tool installed on your operating system. + +Here's an example of how to install with apt: +``` +sudo apt-get install acpi ``` diff --git a/plugins/docker-compose/README.md b/plugins/docker-compose/README.md index 1105e03f6..a81c2c78e 100644 --- a/plugins/docker-compose/README.md +++ b/plugins/docker-compose/README.md @@ -28,3 +28,4 @@ plugins=(... docker-compose) | dclf | `docker-compose logs -f` | Show logs and follow output | | dcpull | `docker-compose pull` | Pull image of a service | | dcstart | `docker-compose start` | Start a container | +| dck | `docker-compose kill` | Kills containers | diff --git a/plugins/docker-compose/docker-compose.plugin.zsh b/plugins/docker-compose/docker-compose.plugin.zsh index 9ffe1edf6..5b25b63b9 100644 --- a/plugins/docker-compose/docker-compose.plugin.zsh +++ b/plugins/docker-compose/docker-compose.plugin.zsh @@ -24,3 +24,4 @@ alias dcl='docker-compose logs' alias dclf='docker-compose logs -f' alias dcpull='docker-compose pull' alias dcstart='docker-compose start' +alias dck='docker-compose kill' diff --git a/plugins/dotenv/README.md b/plugins/dotenv/README.md index f66124731..ab9d329f6 100644 --- a/plugins/dotenv/README.md +++ b/plugins/dotenv/README.md @@ -53,24 +53,30 @@ Set `ZSH_DOTENV_PROMPT=false` in your zshrc file if you don't want the confirmat You can also choose the `Always` option when prompted to always allow sourcing the .env file in that directory. See the next section for more details. -### ZSH_DOTENV_ALLOWED_LIST +### ZSH_DOTENV_ALLOWED_LIST, ZSH_DOTENV_DISALLOWED_LIST The default behavior of the plugin is to always ask whether to source a dotenv file. There's -a **Y**es, **N**o, and **A**lways option. If you choose Always, the directory of the .env file -will be added to an allowed list. If a directory is found in this list, the plugin won't ask -for confirmation and will instead source the .env file directly. +a **Y**es, **N**o, **A**lways and N**e**ver option. If you choose Always, the directory of the .env file +will be added to an allowed list; if you choose Never, it will be added to a disallowed list. +If a directory is found in either of those lists, the plugin won't ask for confirmation and will +instead either source the .env file or proceed without action respectively. -This allowed list is saved by default in `$ZSH_CACHE_DIR/dotenv-allowed.list`. If you want -to change that location, change the `$ZSH_DOTENV_ALLOWED_LIST` variable, like so: +The allowed and disallowed lists are saved by default in `$ZSH_CACHE_DIR/dotenv-allowed.list` and +`$ZSH_CACHE_DIR/dotenv-disallowed.list` respectively. If you want to change that location, +change the `$ZSH_DOTENV_ALLOWED_LIST` and `$ZSH_DOTENV_DISALLOWED_LIST` variables, like so: ```zsh # in ~/.zshrc, before Oh My Zsh is sourced: ZSH_DOTENV_ALLOWED_LIST=/path/to/dotenv/allowed/list +ZSH_DOTENV_DISALLOWED_LIST=/path/to/dotenv/disallowed/list ``` -This file is just a list of directories allowed, separated by a newline character. If you want -to disallow a directory, just edit this file and remove the line for the directory you want to -disallow. +The file is just a list of directories, separated by a newline character. If you want +to change your decision, just edit the file and remove the line for the directory you want to +change. + +NOTE: if a directory is found in both the allowed and disallowed lists, the disallowed list +takes preference, _i.e._ the .env file will never be sourced. ## Version Control diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh index ac3210d7f..24f285df5 100644 --- a/plugins/dotenv/dotenv.plugin.zsh +++ b/plugins/dotenv/dotenv.plugin.zsh @@ -5,6 +5,7 @@ # Path to the file containing allowed paths : ${ZSH_DOTENV_ALLOWED_LIST:="${ZSH_CACHE_DIR:-$ZSH/cache}/dotenv-allowed.list"} +: ${ZSH_DOTENV_DISALLOWED_LIST:="${ZSH_CACHE_DIR:-$ZSH/cache}/dotenv-disallowed.list"} ## Functions @@ -14,19 +15,26 @@ source_env() { if [[ "$ZSH_DOTENV_PROMPT" != false ]]; then local confirmation dirpath="${PWD:A}" - # make sure there is an allowed file + # make sure there is an (dis-)allowed file touch "$ZSH_DOTENV_ALLOWED_LIST" + touch "$ZSH_DOTENV_DISALLOWED_LIST" + + # early return if disallowed + if grep -q "$dirpath" "$ZSH_DOTENV_DISALLOWED_LIST" &>/dev/null; then + return; + fi # check if current directory's .env file is allowed or ask for confirmation if ! grep -q "$dirpath" "$ZSH_DOTENV_ALLOWED_LIST" &>/dev/null; then # print same-line prompt and output newline character if necessary - echo -n "dotenv: found '$ZSH_DOTENV_FILE' file. Source it? ([Y]es/[n]o/[a]lways) " + echo -n "dotenv: found '$ZSH_DOTENV_FILE' file. Source it? ([Y]es/[n]o/[a]lways/n[e]ver) " read -k 1 confirmation; [[ "$confirmation" != $'\n' ]] && echo # check input case "$confirmation" in [nN]) return ;; [aA]) echo "$dirpath" >> "$ZSH_DOTENV_ALLOWED_LIST" ;; + [eE]) echo "$dirpath" >> "$ZSH_DOTENV_DISALLOWED_LIST"; return ;; *) ;; # interpret anything else as a yes esac fi diff --git a/plugins/extract/README.md b/plugins/extract/README.md index 81e8e1d23..b2b731e39 100644 --- a/plugins/extract/README.md +++ b/plugins/extract/README.md @@ -23,6 +23,7 @@ plugins=(... extract) | `bz2` | Bzip2 file | | `deb` | Debian package | | `gz` | Gzip file | +| `ipa` | iOS app package | | `ipsw` | iOS firmware file | | `jar` | Java Archive | | `lrz` | LRZ archive | diff --git a/plugins/extract/_extract b/plugins/extract/_extract index 1a263a744..f96f0d450 100644 --- a/plugins/extract/_extract +++ b/plugins/extract/_extract @@ -3,5 +3,5 @@ _arguments \ '(-r --remove)'{-r,--remove}'[Remove archive.]' \ - "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lrz|lz4|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.lz4|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \ + "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipa|ipsw|jar|lrz|lz4|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.lz4|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \ && return 0 diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index a5594b81a..46e69f08d 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -55,7 +55,7 @@ extract() { (*.lz4) lz4 -d "$1" ;; (*.lzma) unlzma "$1" ;; (*.z) uncompress "$1" ;; - (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;; + (*.zip|*.war|*.jar|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;; (*.rar) unrar x -ad "$1" ;; (*.rpm) mkdir "$extract_dir" && cd "$extract_dir" && rpm2cpio "../$1" | cpio --quiet -id && cd .. ;; (*.7z) 7za x "$1" ;; diff --git a/plugins/httpie/README.md b/plugins/httpie/README.md index 25bdd0c7d..40d60c47d 100644 --- a/plugins/httpie/README.md +++ b/plugins/httpie/README.md @@ -11,4 +11,10 @@ plugins=(... httpie) It uses completion from [zsh-completions](https://github.com/zsh-users/zsh-completions). +## Aliases + +| Alias | Command | +| ------------ | ---------------------------------------------------------------- | +| `https` | `http --default-scheme=https` | + **Maintainer:** [lululau](https://github.com/lululau) diff --git a/plugins/httpie/httpie.plugin.zsh b/plugins/httpie/httpie.plugin.zsh new file mode 100644 index 000000000..088a1f1cf --- /dev/null +++ b/plugins/httpie/httpie.plugin.zsh @@ -0,0 +1,7 @@ +# +# Aliases +# (sorted alphabetically) +# + +alias https='http --default-scheme=https' + diff --git a/plugins/kubectl/README.md b/plugins/kubectl/README.md index c0db59362..ee05a8af1 100644 --- a/plugins/kubectl/README.md +++ b/plugins/kubectl/README.md @@ -33,7 +33,8 @@ plugins=(... kubectl) | kep | `kubectl edit pods` | Edit pods from the default editor | | kdp | `kubectl describe pods` | Describe all pods | | kdelp | `kubectl delete pods` | Delete all pods matching passed arguments | -| kgpl | `kgp -l` | Get pod by label. Example: `kgpl "app=myapp" -n myns` | +| kgpl | `kgp -l` | Get pods by label. Example: `kgpl "app=myapp" -n myns` | +| kgpn | `kgp -n` | Get pods by namespace. Example: `kgpn kube-system` | | | | **Service management** | | kgs | `kubectl get svc` | List all services in ps output format | | kgsw | `kgs --watch` | After listing all services, watch for changes | diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index 92688c53c..647d029c1 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -47,6 +47,9 @@ alias kdelp='kubectl delete pods' # get pod by label: kgpl "app=myapp" -n myns alias kgpl='kgp -l' +# get pod by namespace: kgpn kube-system" +alias kgpn='kgp -n' + # Service management. alias kgs='kubectl get svc' alias kgsa='kubectl get svc --all-namespaces' diff --git a/plugins/mix-fast/mix-fast.plugin.zsh b/plugins/mix-fast/mix-fast.plugin.zsh index e27e30d64..564c50561 100644 --- a/plugins/mix-fast/mix-fast.plugin.zsh +++ b/plugins/mix-fast/mix-fast.plugin.zsh @@ -12,7 +12,7 @@ _mix_does_task_list_need_generating () { } _mix_generate () { - mix help | grep -v 'iex -S' | tail -n +2 | cut -d " " -f 2 > .mix_tasks + mix help | grep '^mix [^ ]' | sed -E "s/mix ([^ ]*) *# (.*)/\1:\2/" > .mix_tasks } _mix () { @@ -21,7 +21,8 @@ _mix () { echo "\nGenerating .mix_tasks..." > /dev/stderr _mix_generate fi - compadd `cat .mix_tasks` + local tasks=(${(f)"$(cat .mix_tasks)"}) + _describe 'tasks' tasks fi } diff --git a/plugins/sudo/sudo.plugin.zsh b/plugins/sudo/sudo.plugin.zsh index f405b025f..51579377d 100644 --- a/plugins/sudo/sudo.plugin.zsh +++ b/plugins/sudo/sudo.plugin.zsh @@ -13,15 +13,28 @@ # ------------------------------------------------------------------------------ sudo-command-line() { - [[ -z $BUFFER ]] && zle up-history - if [[ $BUFFER == sudo\ * ]]; then - LBUFFER="${LBUFFER#sudo }" - elif [[ $BUFFER == $EDITOR\ * ]]; then - LBUFFER="${LBUFFER#$EDITOR }" - LBUFFER="sudoedit $LBUFFER" + [[ -z $BUFFER ]] && LBUFFER="$(fc -ln -1)" + if [[ -n $EDITOR && $BUFFER == $EDITOR\ * ]]; then + if [[ ${#LBUFFER} -le ${#EDITOR} ]]; then + RBUFFER=" ${BUFFER#$EDITOR }" + LBUFFER="sudoedit" + else + LBUFFER="sudoedit ${LBUFFER#$EDITOR }" + fi elif [[ $BUFFER == sudoedit\ * ]]; then - LBUFFER="${LBUFFER#sudoedit }" - LBUFFER="$EDITOR $LBUFFER" + if [[ ${#LBUFFER} -le 8 ]]; then + RBUFFER=" ${BUFFER#sudoedit }" + LBUFFER="$EDITOR" + else + LBUFFER="$EDITOR ${LBUFFER#sudoedit }" + fi + elif [[ $BUFFER == sudo\ * ]]; then + if [[ ${#LBUFFER} -le 4 ]]; then + RBUFFER="${BUFFER#sudo }" + LBUFFER="" + else + LBUFFER="${LBUFFER#sudo }" + fi else LBUFFER="sudo $LBUFFER" fi diff --git a/plugins/timer/README.md b/plugins/timer/README.md index 321307e59..30b0bd00e 100644 --- a/plugins/timer/README.md +++ b/plugins/timer/README.md @@ -3,6 +3,7 @@ This plugin allows to display command's execution time in a very nonintrusive wa Timer can be tuned by these two variables: * `TIMER_PRECISION` allows to control number of decimal places (default `1`) * `TIMER_FORMAT` allows to adjust display format (default `'/%d'`) +* `TIMER_THRESHOLD` allows to set the minimum execution time that causes the timer to be shown (default `0`) Sample session: diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh index 728377c5c..1be7516a3 100644 --- a/plugins/timer/timer.plugin.zsh +++ b/plugins/timer/timer.plugin.zsh @@ -19,9 +19,11 @@ __timer_display_timer_precmd() { local cmd_end_time=$(__timer_current_time) local tdiff=$((cmd_end_time - __timer_cmd_start_time)) unset __timer_cmd_start_time - local tdiffstr=$(__timer_format_duration ${tdiff}) - local cols=$((COLUMNS - ${#tdiffstr} - 1)) - echo -e "\033[1A\033[${cols}C ${tdiffstr}" + if [[ -z "${TIMER_THRESHOLD}" || ${tdiff} -ge "${TIMER_THRESHOLD}" ]]; then + local tdiffstr=$(__timer_format_duration ${tdiff}) + local cols=$((COLUMNS - ${#tdiffstr} - 1)) + echo -e "\033[1A\033[${cols}C ${tdiffstr}" + fi fi } diff --git a/plugins/vscode/README.md b/plugins/vscode/README.md index 469c57ea8..e95ed5d4f 100644 --- a/plugins/vscode/README.md +++ b/plugins/vscode/README.md @@ -1,6 +1,6 @@ # VS Code -This plugin makes interaction between the command line and the VS Code editor easier. +This plugin provides useful aliases to simplify the interaction between the command line and VS Code or VSCodium editor. To start using it, add the `vscode` plugin to your `plugins` array in `~/.zshrc`: @@ -10,23 +10,37 @@ plugins=(... vscode) ## Requirements -To use VS Code in the terminal **in macOS**, first you need to install the `code` command in the PATH, -otherwise you might receive this message: `zsh: command not found: code`. +This plugin requires to have a flavour of VS Code installed and it's executable available in PATH. -[As the docs say](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line), open +You can install either: + +* VS Code (code) +* VS Code Insiders (code-insiders) +* VSCodium (codium) + +### MacOS +While Linux installations will add the executable to PATH, MacOS users might still have to do this manually: + +[For VS Code and VS Code Insiders](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line), open the Command Palette via (F1 or โงโP) and type shell command to find the Shell Command: -> Install 'code' command in PATH +> Shell Command: Install 'code' command in PATH -## VS Code Insiders +[For VSCodium](https://github.com/VSCodium/vscodium/blob/master/DOCS.md#how-do-i-open-vscodium-from-the-terminal), open +the Command Palette via (F1 or โงโP) and type shell command to find the Shell Command: +> Shell Command: Install 'codium' command in PATH -๐ **If you are only using [VS Code Insiders](https://code.visualstudio.com/insiders/), the plugin will automatically bind to your Insiders installation.** +## Using multiple flavours -But, if you have both Stable and Insiders versions and want to configure the plugin to just use the Insiders version, add the following line in the oh-my-zsh settings section (between the `ZSH_THEME` and the `plugins=()` line). This will make the plugin use the Insiders version instead. +If for any reason, you ever require to use multiple flavours of VS Code i.e. VS Code (stable) and VS Code Insiders, you can +manually specify the flavour's executable. Add the following line to the .zshrc file (between the `ZSH_THEME` and the `plugins=()` lines). +This will make the plugin use your manually defined executable. ```zsh ZSH_THEME=... -# Add this line to use code-insiders instead of code +# Choose between one [code, code-insiders or codium] +# The following line will make the plugin to open VS Code Insiders +# Invalid entries will be ignored, no aliases will be added VSCODE=code-insiders plugins=(... vscode) diff --git a/plugins/vscode/vscode.plugin.zsh b/plugins/vscode/vscode.plugin.zsh index 0144e0baa..48d904377 100644 --- a/plugins/vscode/vscode.plugin.zsh +++ b/plugins/vscode/vscode.plugin.zsh @@ -1,17 +1,28 @@ -# VScode zsh plugin +# VS Code (stable / insiders) / VSCodium zsh plugin # Authors: # https://github.com/MarsiBarsi (original author) # https://github.com/babakks +# https://github.com/SteelShot -# Use the stable VS Code release, unless the Insiders version is the only -# available installation -if ! which code > /dev/null && which code-insiders > /dev/null; then - : ${VSCODE:=code-insiders} -else - : ${VSCODE:=code} +# Verify if any manual user choice of VS Code exists first. +if [[ -n "$VSCODE" ]] && ! which $VSCODE &>/dev/null; then + echo "'$VSCODE' flavour of VS Code not detected." + unset VSCODE +fi + +# Otherwise, try to detect a flavour of VS Code. +if [[ -z "$VSCODE" ]]; then + if which code &>/dev/null; then + VSCODE=code + elif which code-insiders &>/dev/null; then + VSCODE=code-insiders + elif which codium &>/dev/null; then + VSCODE=codium + else + return + fi fi -# Define aliases alias vsc="$VSCODE ." alias vsca="$VSCODE --add" alias vscd="$VSCODE --diff" diff --git a/plugins/yarn/README.md b/plugins/yarn/README.md index 05f18a499..fd748b742 100644 --- a/plugins/yarn/README.md +++ b/plugins/yarn/README.md @@ -11,35 +11,36 @@ plugins=(... yarn) ## Aliases -| Alias | Command | Description | -|-------|-------------------------------------------|-------------------------------------------------------------| -| y | `yarn` | The Yarn command | -| ya | `yarn add` | Install a package in dependencies (`package.json`) | -| yad | `yarn add --dev` | Install a package in devDependencies (`package.json`) | -| yap | `yarn add --peer` | Install a package in peerDependencies (`package.json`) | -| yb | `yarn build` | Run the build script defined in `package.json` | -| ycc | `yarn cache clean` | Clean yarn's global cache of packages | -| yd | `yarn dev` | Run the dev script defined in `package.json` | -| yga | `yarn global add` | Install packages globally on your operating system | -| ygls | `yarn global list` | Lists global installed packages | -| ygrm | `yarn global remove` | Remove global installed packages from your OS | -| ygu | `yarn global upgrade` | Upgrade packages installed globally to their latest version | -| yh | `yarn help` | Show help for a yarn command | -| yi | `yarn init` | Interactively creates or updates a package.json file | -| yin | `yarn install` | Install dependencies defined in `package.json` | -| yln | `yarn lint` | Run the lint script defined in `package.json` | -| yls | `yarn list` | List installed packages | -| yout | `yarn outdated` | Check for outdated package dependencies | -| yp | `yarn pack` | Create a compressed gzip archive of package dependencies | -| yrm | `yarn remove` | Remove installed packages | -| yrun | `yarn run` | Run a defined package script | -| ys | `yarn serve` | Start the dev server | -| yst | `yarn start` | Run the start script defined in `package.json` | -| yt | `yarn test` | Run the test script defined in `package.json` | -| ytc | `yarn test --coverage` | Run the test script defined in `package.json` with coverage | -| yuc | `yarn global upgrade && yarn cache clean` | Upgrade global packages and clean yarn's global cache | -| yui | `yarn upgrade-interactive` | Prompt for which outdated packages to upgrade | -| yup | `yarn upgrade` | Upgrade packages to their latest version | -| yv | `yarn version` | Update the version of your package | -| yw | `yarn workspace` | Run a command within a single workspace. | -| yws | `yarn workspaces` | Run a command within all defined workspaces. | +| Alias | Command | Description | +| ----- | ----------------------------------------- | ----------------------------------------------------------------------------- | +| y | `yarn` | The Yarn command | +| ya | `yarn add` | Install a package in dependencies (`package.json`) | +| yad | `yarn add --dev` | Install a package in devDependencies (`package.json`) | +| yap | `yarn add --peer` | Install a package in peerDependencies (`package.json`) | +| yb | `yarn build` | Run the build script defined in `package.json` | +| ycc | `yarn cache clean` | Clean yarn's global cache of packages | +| yd | `yarn dev` | Run the dev script defined in `package.json` | +| yga | `yarn global add` | Install packages globally on your operating system | +| ygls | `yarn global list` | Lists global installed packages | +| ygrm | `yarn global remove` | Remove global installed packages from your OS | +| ygu | `yarn global upgrade` | Upgrade packages installed globally to their latest version | +| yh | `yarn help` | Show help for a yarn command | +| yi | `yarn init` | Interactively creates or updates a package.json file | +| yin | `yarn install` | Install dependencies defined in `package.json` | +| yln | `yarn lint` | Run the lint script defined in `package.json` | +| yls | `yarn list` | List installed packages | +| yout | `yarn outdated` | Check for outdated package dependencies | +| yp | `yarn pack` | Create a compressed gzip archive of package dependencies | +| yrm | `yarn remove` | Remove installed packages | +| yrun | `yarn run` | Run a defined package script | +| ys | `yarn serve` | Start the dev server | +| yst | `yarn start` | Run the start script defined in `package.json` | +| yt | `yarn test` | Run the test script defined in `package.json` | +| ytc | `yarn test --coverage` | Run the test script defined in `package.json` with coverage | +| yuc | `yarn global upgrade && yarn cache clean` | Upgrade global packages and clean yarn's global cache | +| yui | `yarn upgrade-interactive` | Prompt for which outdated packages to upgrade | +| yuil | `yarn upgrade-interactive --latest` | Prompt for which outdated packages to upgrade to the latest available version | +| yup | `yarn upgrade` | Upgrade packages to their latest version | +| yv | `yarn version` | Update the version of your package | +| yw | `yarn workspace` | Run a command within a single workspace. | +| yws | `yarn workspaces` | Run a command within all defined workspaces. | diff --git a/plugins/yarn/yarn.plugin.zsh b/plugins/yarn/yarn.plugin.zsh index 9cfcb7539..4a5192c61 100644 --- a/plugins/yarn/yarn.plugin.zsh +++ b/plugins/yarn/yarn.plugin.zsh @@ -24,6 +24,7 @@ alias yt="yarn test" alias ytc="yarn test --coverage" alias yuc="yarn global upgrade && yarn cache clean" alias yui="yarn upgrade-interactive" +alias yuil="yarn upgrade-interactive --latest" alias yup="yarn upgrade" alias yv="yarn version" alias yw="yarn workspace" |