diff options
| author | Tim Abell <tim@timwise.co.uk> | 2024-06-13 17:08:14 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-13 18:08:14 +0200 |
| commit | 0c9b42a863778d67aee22bbd43f296110fe1f047 (patch) | |
| tree | 22752f6bb22c249a4f693895b7af7656aa57533d | |
| parent | 8908e6d7207223d876b9a74f0be0f0ebb01b361f (diff) | |
| download | zsh-0c9b42a863778d67aee22bbd43f296110fe1f047.tar.gz zsh-0c9b42a863778d67aee22bbd43f296110fe1f047.tar.bz2 zsh-0c9b42a863778d67aee22bbd43f296110fe1f047.zip | |
docs(alias-finder): add some examples (#12502)
| -rw-r--r-- | plugins/alias-finder/README.md | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/plugins/alias-finder/README.md b/plugins/alias-finder/README.md index 6c87c723a..a9bbd0838 100644 --- a/plugins/alias-finder/README.md +++ b/plugins/alias-finder/README.md @@ -2,7 +2,7 @@ This plugin searches the defined aliases and outputs any that match the command inputted. This makes learning new aliases easier. -## Usage +## Setup To use it, add `alias-finder` to the `plugins` array of your zshrc file: ``` @@ -22,6 +22,41 @@ zstyle ':omz:plugins:alias-finder' cheaper yes # disabled by default As you can see, options are also available with zstyle. +## Usage + +When you execute a command alias finder will look at your defined aliases and suggest shorter aliases you could have used, for example: + +Running the un-aliased `git status` command: +```sh +╭─tim@fox ~/repo/gitopolis ‹main› +╰─$ git status + +gst='git status' # <=== shorter suggestion from alias-finder + +On branch main +Your branch is up-to-date with 'origin/main'. +nothing to commit, working tree clean +``` + +Running a shorter `git st` alias from `.gitconfig` that it suggested : +```sh +╭─tim@fox ~/repo/gitopolis ‹main› +╰─$ git st +gs='git st' # <=== shorter suggestion from alias-finder +## main...origin/main +``` + +Running the shortest `gs` shell alias that it found: +```sh +╭─tim@fox ~/repo/gitopolis ‹main› +╰─$ gs + # <=== no suggestions alias-finder because this is the shortest +## main...origin/main +``` + + + + ### Options > In order to clarify, let's say `alias a=abc` has source 'abc' and destination 'a'. |
