The following command gives me in the pager Most/Less
man -k background
alt text http://files.getdropbox.com/u/175564/apropos-colors.png
The picture has everything in green, even descriptions. I would like to set them yellow.
How can you have set the descriptions yellow in Less/Most by Less_termcap?
My variables which affect Less
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking
export LESS_TERMCAP_md=$'\E[01;38;5;74m' # bold in blue
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;33;146m' # begin underline is now yellow
# | | |
# | |----------------- yellow
# |-------------------- underline
# to have the indication of cursor's location and line numbers
export LESS="-mN"
This will do the trick:
You could do a function:
Then you could do:
and the commands would be in your default color and the descriptions would be yellow. The "33" after the square bracket stands for yellow. You can substitute another number for another color. One place to get a list of colors and their codes is
man 5 dir_colors
.And, of course, you have to use
less -R
(or set $LESS to include it) to see the colors inless
.Here is a more portable version that uses
tput
:See
man tput
andman 5 terminfo
(in the "Color Handling" section) for more info, including a list of color numbers thatsetaf
understands.