zsh:alias: Manually expand aliases anywhere

When passing a full command as arguments to another (e.g. `sudo`),
aliases are not expanded.

Add the `$` alias that makes it possible to expand a following alias
anywhere. This uses the feature that aliases ending in a space will
trigger alias expansion on the next argument.

See: https://unix.stackexchange.com/a/433849
This commit is contained in:
2023-04-24 11:50:52 +02:00
parent b24541fb42
commit e81d3005c5

View File

@@ -55,6 +55,9 @@ fi
alias -g no1='>/dev/null'
alias -g no2='2>/dev/null'
alias -g noO='&>/dev/null'
# Manually trigger alias expansion for the next word
# Taken from https://unix.stackexchange.com/a/433849
alias -g '$= '
# Git
alias g='git'