Add Some Color to Man Pages

June 14, 2021 - Reading time: ~1 minute

I was looking through my .bashrc and came across this. I've been using it so long that I had forgotten that colorized Man pages aren't usually the default. I can't remember where I found it.

Add some color to your man pages.

    man() {
    LESS_TERMCAP_md=$'\e[01;31m' \
    LESS_TERMCAP_me=$'\e[0m' \
    LESS_TERMCAP_us=$'\e[01;32m' \
    LESS_TERMCAP_ue=$'\e[0m' \
    LESS_TERMCAP_so=$'\e[45;93m' \
    LESS_TERMCAP_se=$'\e[0m' \
    command man "$@"
    }

Categories