[clug] Coloured manpages

Scott Ferguson scott.ferguson.clug at gmail.com
Mon Feb 17 19:29:05 MST 2014


On 18/02/14 12:30, Ivan Lazar Miljenovic wrote:
> 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).


tweak just most with ~/.mostrc (or /etc/most.conf)
% Color settings
color status yellow blue
color underline yellow black
color normal lightgray black
color overstrike brightblue black

> 
>>
>> (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
> 
> 
> 

Kind regards



More information about the linux mailing list