[clug] Coloured manpages
Jamie Carl
jazz at funkynerd.com
Mon Feb 17 18:09:34 MST 2014
Nice. I just cut and paste that into my .bashrc file and tested with
great success.
It's just another one of those little things that makes daily life
slightly more pleasant under Linux.
Thanks Hal,
Jamie
On 18/02/14 12:04, Hal Ashburner wrote:
> Getting coloured output from manpages brought me some joy today! Hopefully
> someone or other of you manages a smile. This is the kind of thing that
> often get past me for years(!)
>
> http://linuxtidbits.wordpress.com/2009/03/23/less-colors-for-man-pages/
>
> which can be wrapped like so:
>
> man() {
> env \
> LESS_TERMCAP_mb=$(printf "\e[1;31m") \
> LESS_TERMCAP_md=$(printf "\e[1;38;5;74m") \
> LESS_TERMCAP_me=$(printf "\e[0m") \
> LESS_TERMCAP_se=$(printf "\e[0m") \
> LESS_TERMCAP_so=$(printf "\e[1;38;5;246m") \
> LESS_TERMCAP_ue=$(printf "\e[0m") \
> LESS_TERMCAP_us=$(printf "\e[04;38;5;146m") \
> man "$@"
> }
>
> if that floats your boat.
>
> (also in my shellrc are settings for ls & grep which along with tweaks to
> .hgrc and compiling with clang make me happy)
>
> # Enable directory colours
> [[ $OSTYPE == "linux" ]] && eval `dircolors`
> [[ $OSTYPE == "linux" ]] && alias ls="ls --color=auto -F"
> alias grep="grep --color=auto"
>
> Hope you're having fun.
More information about the linux
mailing list