diff options
author | Dmitry Ilvokhin <d@ilvokhin.com> | 2024-12-21 17:35:35 +0000 |
---|---|---|
committer | Dmitry Ilvokhin <d@ilvokhin.com> | 2024-12-21 17:35:35 +0000 |
commit | b2f101f25487c7878c15e2c3f0624ee0e816bde3 (patch) | |
tree | 7bb73d5661cf550eb703a376dbe45645a45f76ce /misc/dotfiles | |
parent | 8703356cb37724a3f15c586828fbd20617f162fb (diff) | |
download | infra-b2f101f25487c7878c15e2c3f0624ee0e816bde3.tar.gz infra-b2f101f25487c7878c15e2c3f0624ee0e816bde3.tar.bz2 infra-b2f101f25487c7878c15e2c3f0624ee0e816bde3.zip |
Enable colored output for `ls`, `grep` and `diff`
Diffstat (limited to 'misc/dotfiles')
-rw-r--r-- | misc/dotfiles/bashrc.j2 | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/misc/dotfiles/bashrc.j2 b/misc/dotfiles/bashrc.j2 index 70bbdbe..d0a69a6 100644 --- a/misc/dotfiles/bashrc.j2 +++ b/misc/dotfiles/bashrc.j2 @@ -3,6 +3,15 @@ if [ -f /etc/bashrc ]; then . /etc/bashrc fi +# Enable colors for `ls` output, but not on macOS, see `CLICOLOR` comment. +alias ls="ls --color=auto" + +# Enable colors for `grep` output. +alias grep="grep --color=auto" + +# Enable colors for `diff` output. +alias diff='diff --color=auto' + {% if ansible_facts['os_family'] == "Darwin" %} # Specific settings for macOS. if [[ "$OSTYPE" == "darwin"* ]]; then @@ -16,7 +25,8 @@ export LC_CTYPE=en_US.UTF-8 # Silence bash deprecation warning. export BASH_SILENCE_DEPRECATION_WARNING=1 -# Enable colors for `ls` output. +# Enable colors for `ls` output. `ls` in macOS is separate from `bash` and +# normal trick with alias doesn't work. export CLICOLOR=1 # Get GitHub token from keychain to avoid homebrew rate limiting on GitHub |