Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
colored man pages using less
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Vicfred
n00b
n00b


Joined: 17 Nov 2009
Posts: 10

PostPosted: Thu Mar 18, 2010 10:31 am    Post subject: colored man pages using less Reply with quote

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
View user's profile Send private message
aCOSwt
Bodhisattva
Bodhisattva


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Thu Mar 18, 2010 12:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Thu Mar 18, 2010 2:27 pm    Post subject: Reply with quote

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
View user's profile Send private message
aCOSwt
Bodhisattva
Bodhisattva


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Thu Mar 18, 2010 2:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
Vicfred
n00b
n00b


Joined: 17 Nov 2009
Posts: 10

PostPosted: Mon Mar 22, 2010 8:24 am    Post subject: Reply with quote

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
View user's profile Send private message
yngwin
Retired Dev
Retired Dev


Joined: 19 Dec 2002
Posts: 4572
Location: Suzhou, China

PostPosted: Mon Mar 22, 2010 9:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Tue Mar 23, 2010 4:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
Vicfred
n00b
n00b


Joined: 17 Nov 2009
Posts: 10

PostPosted: Tue Jan 25, 2011 7:03 am    Post subject: Reply with quote

sorry to post in this old thread but I just fixed the problem, here is how someone helped me http://unix.stackexchange.com/questions/6010/colored-man-pages-not-working-on-gentoo

resume: I added
Code:
export GROFF_NO_SGR=1
to my .zshrc
Back to top
View user's profile Send private message
sipingal
n00b
n00b


Joined: 12 May 2008
Posts: 63
Location: China

PostPosted: Fri Jan 28, 2011 2:18 pm    Post subject: Reply with quote

@Vicfred FYI, https://forums.gentoo.org/viewtopic-t-749285-highlight-colorize.html
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum