diff options
author | Marc Cornellà <marc.cornella@live.com> | 2016-10-04 13:55:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-04 13:55:11 +0200 |
commit | f701b4de0fb55b71e2cfb17522a08fba741ff170 (patch) | |
tree | 82aa7d2dcc73682bf8f4ad8bc7750924bdb8444a | |
parent | 6eaa868cd9ad8447973a53f09453121d58366a6a (diff) | |
download | zsh-f701b4de0fb55b71e2cfb17522a08fba741ff170.tar.gz zsh-f701b4de0fb55b71e2cfb17522a08fba741ff170.tar.bz2 zsh-f701b4de0fb55b71e2cfb17522a08fba741ff170.zip |
Fix formatting and usage section
Also:
- Changes `globes` (which doesn't exist) to `glob expressions`.
- Delete the `trigger autocompletion to your current aliases` use case, since that's not
really implemented.
-rw-r--r-- | plugins/globalias/README.md | 55 |
1 files changed, 40 insertions, 15 deletions
diff --git a/plugins/globalias/README.md b/plugins/globalias/README.md index db2e5bee0..ba9888ccb 100644 --- a/plugins/globalias/README.md +++ b/plugins/globalias/README.md @@ -1,37 +1,62 @@ -#Globalias +# Globalias plugin +Expands all glob expressions, subcommands and aliases (including global). -Expands all globes, backtick expressions and aliases(including global). +Idea from: http://blog.patshead.com/2012/11/automatically-expaning-zsh-global-aliases---simplified.html. + +## Usage + +Add `globalias` to the plugins array in your zshrc file: + +```zsh +plugins=(... globalias) +``` + +Then just press `SPACE` to trigger the expansion of a command you've written. + +If you only want to insert a space without expanding the command line, press +`CTRL`+`SPACE`. + +## Examples + +#### Glob expressions ``` $ touch {1..10}<space> -#expands to +# expands to $ touch 1 2 3 4 5 6 7 8 9 10 +$ ls **/*.json<space> +# expands to +$ ls folder/file.json anotherfolder/another.json +``` + +#### Subcommands + +``` $ mkdir "`date -R`" -#expands to +# expands to $ mkdir Tue,\ 04\ Oct\ 2016\ 13:54:03\ +0300 -#.zshrc: +``` + +#### Aliases + +``` +# .zshrc: alias -g G="| grep --color=auto -P" alias l='ls --color=auto -lah' $ l<space>G<space> -#expands to +# expands to $ ls --color=auto -lah | grep --color=auto -P - -ls **/*.json<space> -#expands to -ls folder/file.json anotherfolder/another.json ``` -####Returns autocompletion to your custom aliases: ``` -#.zsrc +# .zsrc: alias S="sudo systemctl" $ S<space> -#expands to: -sudo systemctl s<tab> -#trigger autocompletion +# expands to: +$ sudo systemctl ``` |