Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/momo-lab/zsh-abbrev-alias

This zsh plugin provides functionality similar to Vim's abbreviation expansion.
https://github.com/momo-lab/zsh-abbrev-alias

zle-widgets zsh zsh-plugin zsh-plugins

Last synced: 2 months ago
JSON representation

This zsh plugin provides functionality similar to Vim's abbreviation expansion.

Lists

README

        

# zsh-abbrev-alias
This zsh plugin provides functionality similar to Vim's abbreviation expansion.

This plugin consulted http://zshwiki.org/home/examples/zleiab .

See https://github.com/momo-lab/bash-abbrev-alias for bash version.

## Installation
### Using [zplug](https://github.com/b4b4r07/zplug)

```zsh
zplug "momo-lab/zsh-abbrev-alias"
```

Alias settings are written after `zplug load`.

## For Example

```zsh
$ abbrev-alias -g G="| grep"
$ ps aux G
->
$ ps aux | grep
```

```zsh
$ git branch
* master
$ abbrev-alias -ge B='$(git symbolic-ref --short HEAD 2> /dev/null)'
$ git push origin B
->
$ git push origin master
```

```zsh
$ abbrev-alias d='docker'
$ d
->
$ docker
$ abbrev-alias -r dr='d run --rm -it'
$ dr
->
$ docker run --rm -it
```

## Notes
This plugin is compatible with https://github.com/MichaelAquilina/zsh-you-should-use,
you only need to source it first

## Help
Show `abbrev-alias --help`.

```zsh
$ abbrev-alias --help
abbrev-alias 0.3.0
USAGE:
abbrev-alias [OPTIONS] {name=value ...}
abbrev-alias -u {name ...}
abbrev-alias --init

OPTIONS:
-c, --command register alias as 'alias name=value'
-g, --global register alias as 'alias -g name=value' like
-e, --eval evaluates subshells on expansion
-r, --recursive expand aliases recursively
-u, --unset unregister alias
-i, --init initialize abbrev-alias. execute with .zshrc
-h, --help show this help
-v, --version show version
```