This plugin let your zsh automatically expands all glob expressions, subcommands, normal aliases, and global aliases.
Try it with zinit, or your favorite plugin manager.
zinit light simnalamburt/zsh-expand-all
Then just use your zsh as usual. Your aliases will be automatically expanded. If you only want to insert a space without expanding the command line, press ctrl + space.
$ 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
$ mkdir "`date -R`"
# expands to
$ mkdir Tue,\ 04\ Oct\ 2016\ 13:54:03\ +0300
# .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
You can disable certain features with $ZSH_EXPAND_ALL_DISABLE
environment
variable.
ZSH_EXPAND_ALL_DISABLE= # All features are enabled
ZSH_EXPAND_ALL_DISABLE=alias # Disable alias expanding
ZSH_EXPAND_ALL_DISABLE=word # Disable word expanding
ZSH_EXPAND_ALL_DISABLE=alias,word # Disable alias and word expanding
This project was forked from globalias of Oh My Zsh.
- zshmisc, Christian 'strcat' Schneider
- ZSH Abbreviations, Matt Foster, 2009-01-23
- Cloning vim's abbreviation feature, Mikachu, 2011-04-22
- Automatically Expanding zsh Global Aliases As You Type, Pat Regan, 2011-07-08
- Automatically Expanding zsh Global Aliases - Simplified, Pat Regan, 2012-11-04
zsh-expand-all is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0). See COPYRIGHT for details.