I use these suffix aliases to open programs occasionally.
alias -g G='| grep'
alias -g R='| rg'
alias -g L='| less'
alias -g V='| vim -'
alias -g S='| subl'
And if I want Zsh to auto-expand it out to type the full command (after pressing space), add this to end of your .zshrc: globalias() {
if [[ $LBUFFER =~ '[A-Z0-9]+$' ]]; then
zle _expand_alias
zle expand-word
fi
zle self-insert
}
zle -N globalias
bindkey " " globalias # space key to expand globalalias
Identical examples: grep -rw --exclude-dir={test,build} 'throw' L
grep -rw --exclude-dir={test,build} 'throw' | less