diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2023-11-04 18:38:46 -0700 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2023-11-04 18:38:46 -0700 |
commit | 4d908094fdc2a0c0e9a0a072eba213fab7adef43 (patch) | |
tree | 7c17e70bcdeebbe96c84d849bdf17882007480d8 /plugins/alias-finder/README.md | |
parent | 4b0bbc0b263a150eb9a9b59f196914629be06a9b (diff) | |
parent | 632ed413a9ce62747ded83d7736491b081be4b49 (diff) | |
download | zsh-4d908094fdc2a0c0e9a0a072eba213fab7adef43.tar.gz zsh-4d908094fdc2a0c0e9a0a072eba213fab7adef43.tar.bz2 zsh-4d908094fdc2a0c0e9a0a072eba213fab7adef43.zip |
Diffstat (limited to 'plugins/alias-finder/README.md')
-rw-r--r-- | plugins/alias-finder/README.md | 55 |
1 files changed, 21 insertions, 34 deletions
diff --git a/plugins/alias-finder/README.md b/plugins/alias-finder/README.md index 409f4b653..6c87c723a 100644 --- a/plugins/alias-finder/README.md +++ b/plugins/alias-finder/README.md @@ -2,45 +2,32 @@ This plugin searches the defined aliases and outputs any that match the command inputted. This makes learning new aliases easier. +## Usage + To use it, add `alias-finder` to the `plugins` array of your zshrc file: ``` plugins=(... alias-finder) ``` -## Usage -To see if there is an alias defined for the command, pass it as an argument to `alias-finder`. This can also run automatically before each command you input - add `ZSH_ALIAS_FINDER_AUTOMATIC=true` to your zshrc if you want this. +To enable it for every single command, set zstyle in your `~/.zshrc`. -## Options +```zsh +# ~/.zshrc -- Use `--longer` or `-l` to allow the aliases to be longer than the input (match aliases if they contain the input). -- Use `--exact` or `-e` to avoid matching aliases that are shorter than the input. - -## Examples -``` -$ alias-finder "git pull" -gl='git pull' -g=git -``` -``` -$ alias-finder "web_search google oh my zsh" -google='web_search google' -``` -``` -$ alias-finder "git commit -v" -gc="git commit -v" -g=git -``` -``` -$ alias-finder -e "git commit -v" -gc='git commit -v' -``` -``` -$ alias-finder -l "git commit -v" -gc='git commit -v' -'gc!'='git commit -v --amend' -gca='git commit -v -a' -'gca!'='git commit -v -a --amend' -'gcan!'='git commit -v -a --no-edit --amend' -'gcans!'='git commit -v -a -s --no-edit --amend' -'gcn!'='git commit -v --no-edit --amend' +zstyle ':omz:plugins:alias-finder' autoload yes # disabled by default +zstyle ':omz:plugins:alias-finder' longer yes # disabled by default +zstyle ':omz:plugins:alias-finder' exact yes # disabled by default +zstyle ':omz:plugins:alias-finder' cheaper yes # disabled by default ``` + +As you can see, options are also available with zstyle. + +### Options + +> In order to clarify, let's say `alias a=abc` has source 'abc' and destination 'a'. + +- Use `--longer` or `-l` to include aliases where the source is longer than the input (in other words, the source could contain the whole input). +- Use `--exact` or `-e` to avoid aliases where the source is shorter than the input (in other words, the source must be the same with the input). +- Use `--cheaper` or `-c` to avoid aliases where the destination is longer than the input (in other words, the destination must be the shorter than the input). + + |