Invoke grc terminal colorizer on ALL commands implicitly
The grc.bashrc and grc.zsh files provided with grc since v1.9 does this in a (non-complete) way by adding aliases for common commands:
grc.bashrc
GRC=`which grc`
if [ "$TERM" != dumb ] && [ -n "$GRC" ]
then
alias colourify="$GRC -es --colour=auto"
alias configure='colourify ./configure'
alias diff='colourify diff'
alias make='colourify make'
alias gcc='colourify gcc'
alias g++='colourify g++'
alias as='colourify as'
alias gas='colourify gas'
alias ld='colourify ld'
alias netstat='colourify netstat'
alias ping='colourify ping'
alias traceroute='colourify /usr/sbin/traceroute'
alias head='colourify head'
alias tail='colourify tail'
alias dig='colourify dig'
alias mount='colourify mount'
alias ps='colourify ps'
alias mtr='colourify mtr'
alias df='colourify df'
fi
grc.zsh
if [[ "$TERM" != dumb ]] && (( $+commands[grc] )) ; then
# Prevent grc aliases from overriding zsh completions.
setopt COMPLETE_ALIASES
# Supported commands
cmds=(
cc \
configure \
cvs \
df \
diff \
dig \
gcc \
gmake \
ifconfig \
last \
ldap \
ls \
make \
mount \
mtr \
netstat \
ping \
ping6 \
ps \
traceroute \
traceroute6 \
wdiff \
);
# Set alias for available commands.
for cmd in $cmds ; do
if (( $+commands[$cmd] )) ; then
alias $cmd="grc --colour=auto $cmd"
fi
done
# Clean up variables
unset cmds cmd
fi