diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2016-10-09 11:18:56 -0600 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2016-10-09 11:18:56 -0600 |
commit | a2baf45bce6bb8b501512233441af8f65f90a775 (patch) | |
tree | 3c0b773ed3b77c37ee1d609277a0e8f44d8899f9 /plugins/globalias/README.md | |
parent | 4af1cb74ad3c3275d3352febf9e14e19f368d65a (diff) | |
parent | cd37d19ddaf9cc5acbf443f93f88ca355f74090d (diff) | |
download | zsh-a2baf45bce6bb8b501512233441af8f65f90a775.tar.gz zsh-a2baf45bce6bb8b501512233441af8f65f90a775.tar.bz2 zsh-a2baf45bce6bb8b501512233441af8f65f90a775.zip |
Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh
Diffstat (limited to 'plugins/globalias/README.md')
-rw-r--r-- | plugins/globalias/README.md | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/plugins/globalias/README.md b/plugins/globalias/README.md new file mode 100644 index 000000000..ba9888ccb --- /dev/null +++ b/plugins/globalias/README.md @@ -0,0 +1,62 @@ +# Globalias plugin + +Expands all glob expressions, subcommands 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 +$ 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 +$ mkdir Tue,\ 04\ Oct\ 2016\ 13:54:03\ +0300 + +``` + +#### Aliases + +``` +# .zshrc: +alias -g G="| grep --color=auto -P" +alias l='ls --color=auto -lah' + +$ l<space>G<space> +# expands to +$ ls --color=auto -lah | grep --color=auto -P +``` + +``` +# .zsrc: +alias S="sudo systemctl" + +$ S<space> +# expands to: +$ sudo systemctl +``` |