0c9b42a863778d67aee22bbd43f296110fe1f047

Author
Tim Abell <tim@timwise.co.uk>
Committer
GitHub <noreply@github.com>
Date

Message

docs(alias-finder): add some examples (#12502)

Diff

 1diff --git a/plugins/alias-finder/README.md b/plugins/alias-finder/README.md
 2index 6c87c723a99b5e311b5f4b4c175b045281152cb9..a9bbd08387de8cf04dcc0b198191e1353eb6623f 100644
 3--- a/plugins/alias-finder/README.md
 4+++ b/plugins/alias-finder/README.md
 5@@ -2,7 +2,7 @@
 6 
 7 This plugin searches the defined aliases and outputs any that match the command inputted. This makes learning new aliases easier.
 8 
 9-## Usage
10+## Setup
11 
12 To use it, add `alias-finder` to the `plugins` array of your zshrc file:
13 ```
14@@ -22,6 +22,41 @@ zstyle ':omz:plugins:alias-finder' cheaper yes # disabled by default
15 
16 As you can see, options are also available with zstyle.
17 
18+## Usage
19+
20+When you execute a command alias finder will look at your defined aliases and suggest shorter aliases you could have used, for example:
21+
22+Running the un-aliased `git status` command:
23+```sh
24+╭─tim@fox ~/repo/gitopolis ‹main› 
25+╰─$ git status
26+
27+gst='git status'         # <=== shorter suggestion from alias-finder
28+
29+On branch main
30+Your branch is up-to-date with 'origin/main'.
31+nothing to commit, working tree clean
32+```
33+
34+Running a shorter `git st` alias from `.gitconfig` that it suggested :
35+```sh
36+╭─tim@fox ~/repo/gitopolis ‹main› 
37+╰─$ git st
38+gs='git st'         # <=== shorter suggestion from alias-finder
39+## main...origin/main
40+```
41+
42+Running the shortest `gs` shell alias that it found:
43+```sh
44+╭─tim@fox ~/repo/gitopolis ‹main› 
45+╰─$ gs
46+         # <=== no suggestions alias-finder because this is the shortest
47+## main...origin/main
48+```
49+
50+![image](https://github.com/ohmyzsh/ohmyzsh/assets/19378/39642750-fb10-4f1a-b7f9-f36789eeb01b)
51+
52+
53 ### Options
54 
55 > In order to clarify, let's say `alias a=abc` has source 'abc' and destination 'a'.