It's easy to do a one word alias in ZSH.
alias ll='ls -lah'
Is there a way to do two word aliases with Zsh, so that both words are parsed as part of the same alias? I'd mostly like to use it for typo fixes.
alias 'gits t'='git st'
It's easy to do a one word alias in ZSH.
alias ll='ls -lah'
Is there a way to do two word aliases with Zsh, so that both words are parsed as part of the same alias? I'd mostly like to use it for typo fixes.
alias 'gits t'='git st'
Try this:
alias func='gits t'
func() {
'gits t'='git st'
}
more info here about Zsh alias functions:
The same as in plain bash:
$ cd
$ vim .zshrc
...
tg() {
if [ -z "$1" ]; then
echo "Use correct second argument: apply/destroy/plan/etc"
else
if [ "$1" = "0all" ]; then
terragrunt destroy -auto-approve && terragrunt apply -auto-approve
elif [ "$1" = "0apply" ]; then
terragrunt apply -auto-approve
elif [ "$1" = "0destroy" ]; then
terragrunt destroy -auto-approve
else
terragrunt "$@"
fi
fi
}
...
Don't forget to reread file:
$ source .zshrc
And after use e.g.:
$ tg 0apply