[clug] Coloured manpages

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Mon Feb 17 18:30:12 MST 2014


On 18 February 2014 12:04, Hal Ashburner <hal at ashburner.info> 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.

I found this and tried using it on a freshly installed Fedora 20 using
Gnome 3, and for some reason the Gnome terminal wouldn't display them
(except for possibly the bottom bar being a different colour).  It
worked in xterm though...

So I went back to just using most for my pager for man, even though it
has some weird aspects to it (when searching, a coloured word counts
as two search results :s).

>
> (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.
> --
> linux mailing list
> linux at lists.samba.org
> https://lists.samba.org/mailman/listinfo/linux



-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
http://IvanMiljenovic.wordpress.com


More information about the linux mailing list