1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-11-23 20:11:31 +01:00

replace grc aliases with the sourcing of the correct file

This commit is contained in:
bretello 2020-02-14 16:37:42 +01:00
parent c0ac8250f1
commit 3c048d2d48

View File

@ -70,54 +70,15 @@ alias mdiff="mate -t source.diff"
alias ssh1="ssh -o ControlMaster=no"
# Some colorizing options for grc
if [[ "$TERM" != dumb ]] && [[ -f $(which grc) ]] ; then
# Prevent grc aliases from overriding zsh completions.
setopt COMPLETE_ALIASES
# Supported commands
cmds=(
ls \
cc \
configure \
cvs \
df \
diff \
dig \
gcc \
gmake \
ifconfig \
iptables \
last \
ldap \
make \
mount \
mtr \
netstat \
ping \
ping6 \
ps \
ss \
traceroute \
traceroute6 \
wdiff \
);
# Set alias for available commands.
for cmd in $cmds ; do
if [[ -f $(which $cmd) ]] ; then
alias $cmd="grc --colour=on $cmd"
fi
done
# Clean up variables
unset cmds cmd
# grc: try to source the definitions file in /etc/grc.zsh (print a warning if it does not exist)
if [[ -f /etc/grc.zsh ]]; then
echo "Could not find /etc/grc.zsh, command colorization will not work. Check your grc configuration" 1>&2
else
source /etc/grc.zsh
fi
# dotfiles user aliases
if [[ -f ~/.dotfiles_aliases ]];
then
source ~/.dotfiles_aliases
fi