View previous topic :: View next topic |
Author |
Message |
sipingal n00b
Joined: 12 May 2008 Posts: 62 Location: China
|
Posted: Tue Mar 24, 2009 4:53 am Post subject: Colorize manpage on Gentoo |
|
|
There is little difference on Gentoo Linux. I am introducing two solutions to implement it.
Solution I
======
Using sys-apps/man & sys-apps/most
1. Install sys-apps/most
Code: | # emerge -v sys-apps/most |
2. Modify /etc/man.conf
Code: | NROFF /usr/bin/nroff -mandoc |
to
Code: | NROFF /usr/bin/nroff -c -mandoc |
3. Copy a rcfile of the most
Code: | $ bzcat /usr/share/doc/most-5.0.0a/lesskeys.rc.bz2 > ~/.mostrc |
4. Place PAGER environment variable to user's profile(such as ~/.bashrc or ~/.profile etc.)
Code: | # export PAGER=most |
Solution II
======
Using sys-apps/man-db & sys-apps/less
1. Install sys-apps/man-db
Code: | # emerge -Cv sys-apps/man
# emerge -v sys-apps/man-db
# emerge -v sys-apps/less |
2. Modify /etc/man_db.conf
Code: | #DEFINE nroff nroff -mandoc |
to
Code: | DEFINE nroff nroff -c -mandoc |
3. Place the less related environment variables to user's profile
Code: | 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' |
Verify the effects
Now we can test the screen of a manpage:
Last edited by sipingal on Wed Mar 25, 2009 1:10 am; edited 1 time in total |
|
Back to top |
|
|
ppurka Advocate
Joined: 26 Dec 2004 Posts: 3256
|
|
Back to top |
|
|
sipingal n00b
Joined: 12 May 2008 Posts: 62 Location: China
|
Posted: Tue Mar 24, 2009 7:46 am Post subject: |
|
|
Thank you very much.
The vimpager is very cool. I compared the vimmanpager with most/less. The vimpager is more colorful & beautiful. But it seems the vimpager loses many colors. Any body knows how to fix it?
I used following comand to compared the output:
|
|
Back to top |
|
|
ppurka Advocate
Joined: 26 Dec 2004 Posts: 3256
|
|
Back to top |
|
|
timeBandit Bodhisattva
Joined: 31 Dec 2004 Posts: 2719 Location: here, there or in transit
|
Posted: Tue Mar 24, 2009 3:35 pm Post subject: |
|
|
Moved from Other Things Gentoo to Documentation, Tips & Tricks.
(Maybe this time I'll finally implement this on my systems. ) _________________ Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others. |
|
Back to top |
|
|
djinnZ Advocate
Joined: 02 Nov 2006 Posts: 4831 Location: somewhere in L.O.S.
|
Posted: Tue Mar 24, 2009 7:41 pm Post subject: |
|
|
remember than the builld of some packages will sure fail with MANPAGER/PAGER set to vimmanpager or most. I not remember exacly what are but the simple solution is to override it for emerge to the default. _________________ scita et risus abundant in ore stultorum sed etiam semper severi insani sunt
mala tempora currunt...mater stultorum semper pregna est
Murpy'sLaw:If anything can go wrong, it will - O'Toole's Corollary:Murphy was an optimist |
|
Back to top |
|
|
Enlight Advocate
Joined: 28 Oct 2004 Posts: 3519 Location: Alsace (France)
|
Posted: Tue Mar 24, 2009 8:07 pm Post subject: |
|
|
M^woman (whithout man) has the same effect in emacs. |
|
Back to top |
|
|
ppurka Advocate
Joined: 26 Dec 2004 Posts: 3256
|
Posted: Tue Mar 24, 2009 8:18 pm Post subject: |
|
|
djinnZ wrote: | remember than the builld of some packages will sure fail with MANPAGER/PAGER set to vimmanpager or most. I not remember exacly what are but the simple solution is to override it for emerge to the default. | Never faced this problem till date. _________________ emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/ |
|
Back to top |
|
|
Nerevar l33t
Joined: 31 May 2008 Posts: 720
|
Posted: Wed Mar 25, 2009 12:06 am Post subject: |
|
|
Solution II works for me w/o installing man-db. Just modify /etc/man.conf instead of /etc/man-db.conf.
Note: It's important that you remove /var/cache/man after making the change to /etc/man.conf. Otherwise you'll still be using the cached version of the manpage which was processed w/o the -c option. |
|
Back to top |
|
|
sipingal n00b
Joined: 12 May 2008 Posts: 62 Location: China
|
Posted: Wed Mar 25, 2009 1:13 am Post subject: Sorry! I made a mistake:( |
|
|
Nerevar wrote: | Solution II works for me w/o installing man-db. Just modify /etc/man.conf instead of /etc/man-db.conf.
Note: It's important that you remove /var/cache/man after making the change to /etc/man.conf. Otherwise you'll still be using the cached version of the manpage which was processed w/o the -c option. |
/etc/man-db.conf should be /etc/man_db.conf. |
|
Back to top |
|
|
swimmer Veteran
Joined: 15 Jul 2002 Posts: 1330 Location: Netherlands
|
Posted: Wed Mar 25, 2009 8:38 am Post subject: |
|
|
vimpager ++ |
|
Back to top |
|
|
djinnZ Advocate
Joined: 02 Nov 2006 Posts: 4831 Location: somewhere in L.O.S.
|
Posted: Wed Mar 25, 2009 11:57 am Post subject: |
|
|
ppurka wrote: | djinnZ wrote: | remember than the builld of some packages will sure fail with MANPAGER/PAGER set to vimmanpager or most. I not remember exacly what are but the simple solution is to override it for emerge to the default. | Never faced this problem till date. | This is an example. Adding a MANPAGER=/usr/bin/less to /etc/make.conf or running Code: | MANPAGER=/usr/bin/less emerge somethingbroken | is the simple fix.
Nothing wrong (i use vimpager) but better advise for possible issues. The affected packages are not often updated (i think gpm and some old base libraries of X have the same troubles) so is reasonable than you have never faced it. Note than the build will hang with MANPAGER=most also (in fact with everything different from less).
The two cents of mine about this tip. _________________ scita et risus abundant in ore stultorum sed etiam semper severi insani sunt
mala tempora currunt...mater stultorum semper pregna est
Murpy'sLaw:If anything can go wrong, it will - O'Toole's Corollary:Murphy was an optimist |
|
Back to top |
|
|
UnoSD Apprentice
Joined: 27 Jun 2011 Posts: 273
|
Posted: Thu Mar 22, 2012 11:14 am Post subject: |
|
|
Nerevar wrote: | Solution II works for me w/o installing man-db. Just modify /etc/man.conf instead of /etc/man-db.conf.
Note: It's important that you remove /var/cache/man after making the change to /etc/man.conf. Otherwise you'll still be using the cached version of the manpage which was processed w/o the -c option. |
It worked for me, too; but some manual don't. Trying "man man" or "man mplayer" works great, but "man most" and "man less" shows me some flat monochrome pages... It seems to be kind of coloured because the "command line" below is with colors, but not the pages... Any idea of how to solve this?
P.s. Have i, perhaps, to emerge man-db? Does it matter? |
|
Back to top |
|
|
linoseros n00b
Joined: 05 Feb 2012 Posts: 3
|
Posted: Fri Mar 23, 2012 10:34 am Post subject: |
|
|
very cool |
|
Back to top |
|
|
|