dotfiles/zsh/lib/colors.zsh

24 lines
831 B
Bash
Raw Normal View History

2022-03-13 23:43:08 +01:00
#!/usr/bin/env zsh
2022-03-16 00:37:54 +01:00
# Use wider color range
export TERM=xterm-256color
2022-03-13 23:43:08 +01:00
# Enable dircolors.
if type -p dircolors &>/dev/null; then
# Enable custom colors if it exists.
[ -e "${XDG_CONFIG_HOME}/dircolors" ] && \
eval "$(dircolors -b "${XDG_CONFIG_HOME}/dircolors")" || \
eval "$(dircolors -b)"
fi
# Colorize 'ls' command. Based on Oh My Zsh;
ls --color -d . &>/dev/null && alias ls='ls --color=tty' || { ls -G . &>/dev/null && alias ls='ls -G' }
alias vdir="vdir --color=auto" # Colorize 'vdir' command.
alias grep="grep --color=auto -i" # Colorize 'grep' command and ignore case.
alias fgrep="grep --color=auto -i" # Colorize 'fgrep' command and ignore case.
alias egrep="grep --color=auto -i" # Colorize 'egrep' command and ignore case.
alias diff="diff --color=auto" # Colorize 'diff' command.