Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

colored man pages using less

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
Vicfred
n00b
n00b
Posts: 10
Joined: Tue Nov 17, 2009 8:25 am

colored man pages using less

  • Quote

Post by Vicfred » Thu Mar 18, 2010 10:31 am

I'm using this to color my man pages in zsh with urxvt

Code: Select all

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?
Top
aCOSwt
Bodhisattva
Bodhisattva
Posts: 2537
Joined: Fri Oct 19, 2007 1:48 pm
Location: Hilbert space

  • Quote

Post by aCOSwt » Thu Mar 18, 2010 12:38 pm

Have you tried to set the R option to less ?
You can try this setting the MANPAGER environment variable to /usr/bin/less -isR
Top
Mike Hunt
Watchman
Watchman
User avatar
Posts: 5287
Joined: Sun Jul 19, 2009 11:01 pm

  • Quote

Post by Mike Hunt » Thu Mar 18, 2010 2:27 pm

Isn't the less R switch already set by default?

Code: Select all

 ~ # cat /etc/env.d/70less
LESSOPEN="|lesspipe.sh %s"
LESS="-R -M --shift 5"
Top
aCOSwt
Bodhisattva
Bodhisattva
Posts: 2537
Joined: Fri Oct 19, 2007 1:48 pm
Location: Hilbert space

  • Quote

Post by aCOSwt » Thu Mar 18, 2010 2:39 pm

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
Top
Vicfred
n00b
n00b
Posts: 10
Joined: Tue Nov 17, 2009 8:25 am

  • Quote

Post by Vicfred » Mon Mar 22, 2010 8:24 am

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 http://bugs.gentoo.org/184604 but nothing worked
Top
yngwin
Retired Dev
Retired Dev
User avatar
Posts: 4572
Joined: Thu Dec 19, 2002 1:22 pm
Location: Suzhou, China

  • Quote

Post by yngwin » Mon Mar 22, 2010 9:36 pm

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
Top
Mike Hunt
Watchman
Watchman
User avatar
Posts: 5287
Joined: Sun Jul 19, 2009 11:01 pm

  • Quote

Post by Mike Hunt » Tue Mar 23, 2010 4:55 pm

Try slightly changing your lines like this, it works here in bash shell with less:

Code: Select all

# 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. :)
Top
Vicfred
n00b
n00b
Posts: 10
Joined: Tue Nov 17, 2009 8:25 am

  • Quote

Post by Vicfred » Tue Jan 25, 2011 7:03 am

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

resume: I added

Code: Select all

export GROFF_NO_SGR=1
to my .zshrc
Top
sipingal
n00b
n00b
User avatar
Posts: 63
Joined: Mon May 12, 2008 11:36 am
Location: China

  • Quote

Post by sipingal » Fri Jan 28, 2011 2:18 pm

@Vicfred FYI, http://forums.gentoo.org/viewtopic-t-74 ... orize.html
Top
Post Reply

9 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic