View previous topic :: View next topic |
Author |
Message |
Vicfred n00b

Joined: 17 Nov 2009 Posts: 10
|
Posted: Thu Mar 18, 2010 10:31 am Post subject: colored man pages using less |
|
|
I'm using this to color my man pages in zsh with urxvt
Code: |
my .zshrc
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m' |
but it isn't working and I know it works because I tested it in another computer/distribution. How do I make gentoo to show colors in my man pages using less? |
|
Back to top |
|
 |
aCOSwt Bodhisattva

Joined: 19 Oct 2007 Posts: 2537 Location: Hilbert space
|
Posted: Thu Mar 18, 2010 12:38 pm Post subject: |
|
|
Have you tried to set the R option to less ?
You can try this setting the MANPAGER environment variable to /usr/bin/less -isR |
|
Back to top |
|
 |
Mike Hunt Watchman


Joined: 19 Jul 2009 Posts: 5287
|
Posted: Thu Mar 18, 2010 2:27 pm Post subject: |
|
|
Isn't the less R switch already set by default? Code: | ~ # cat /etc/env.d/70less
LESSOPEN="|lesspipe.sh %s"
LESS="-R -M --shift 5" |
|
|
Back to top |
|
 |
aCOSwt Bodhisattva

Joined: 19 Oct 2007 Posts: 2537 Location: Hilbert space
|
Posted: Thu Mar 18, 2010 2:39 pm Post subject: |
|
|
Mike Hunt wrote: | Isn't the less R switch already set by default? |
Well, as usual... you are right Mike ! R is actually set as default !
However :
man less wrote: | The environment variable is parsed before the command line, so command line options override the LESS environment variable. |
on one hand and
man man wrote: | By default, man uses /usr/bin/less -is. |
(unless MANPAGER environment variable is set or -P option is given.)
I understand from this that passing -is as options to less, man will override the LESS variable settings |
|
Back to top |
|
 |
Vicfred n00b

Joined: 17 Nov 2009 Posts: 10
|
Posted: Mon Mar 22, 2010 8:24 am Post subject: |
|
|
I still don't have any colors in my man pages, I tried to add/modify the variable MANPAGER/PAGER variable in my zshrc, I modified the /etc/man.conf and I tried this https://bugs.gentoo.org/184604 but nothing worked |
|
Back to top |
|
 |
yngwin Retired Dev


Joined: 19 Dec 2002 Posts: 4572 Location: Suzhou, China
|
Posted: Mon Mar 22, 2010 9:36 pm Post subject: |
|
|
I prefer to use most or vimmanpager as more colorful MANPAGER. _________________ "Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF |
|
Back to top |
|
 |
Mike Hunt Watchman


Joined: 19 Jul 2009 Posts: 5287
|
Posted: Tue Mar 23, 2010 4:55 pm Post subject: |
|
|
Try slightly changing your lines like this, it works here in bash shell with less:
Code: | # Less Colors for Man Pages
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking
export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold
export LESS_TERMCAP_me=$'\E[0m' # end mode
export LESS_TERMCAP_se=$'\E[0m' # end standout-mode
export LESS_TERMCAP_so=$'\E[38;5;246m' # begin standout-mode - info box
export LESS_TERMCAP_ue=$'\E[0m' # end underline
export LESS_TERMCAP_us=$'\E[04;38;5;146m' # begin underline |
aCOSwt wrote: | Well, as usual... you are right Mike ! |
I wish that were true, but alas, not always.  |
|
Back to top |
|
 |
Vicfred n00b

Joined: 17 Nov 2009 Posts: 10
|
|
Back to top |
|
 |
sipingal n00b


Joined: 12 May 2008 Posts: 63 Location: China
|
|
Back to top |
|
 |
|