jan-warchol/selenized

Colorized MAN pages ie LESS_TERMCAP_so

dngray opened this issue · 9 comments

I decided to adapt solarized-man.plugin.zsh however I am having trouble with LESS_TERMCAP_so getting that to look like the solarized theme.

I read this guide hoping it would help. Here's what I have so far:

function man() {
    env \
        LESS_TERMCAP_mb=$(printf "\e[1;31m") \
        LESS_TERMCAP_md=$(printf "\e[1;31m") \
        LESS_TERMCAP_me=$(printf "\e[0m") \
        LESS_TERMCAP_se=$(printf "\e[0m") \
        LESS_TERMCAP_so=$(printf "\e[0;39;47m") \
        LESS_TERMCAP_ue=$(printf "\e[0m") \
        LESS_TERMCAP_us=$(printf "\e[4;32m") \
        PAGER="${commands[less]:-$PAGER}" \
        _NROFF_U=1 \
        GROFF_NO_SGR=1 \
        PATH=${HOME}/bin:${PATH} \
    man "$@"
}

1565021052 Termite is on the left with Solarized and urxvt is on the right with Selenized.

Alternatively using the terminal codes the nearest I could get was:

LESS_TERMCAP_so=$(printf "\e[1;47;1;37m") \

Which resulted in:

1565067478

LESS_TERMCAP_so=$(printf "\e[30;39;100m") \

This looks nice too:

1565069468

Curious to know what one you think looks best @jan-warchol

Looks okay with the other color schemes too:

1565069905

I don't really know what I am doing with the codes, so if it's wrong please do tell me.

Hello! Thanks for your interest, issues and pull requests - they are very welcome! :-) I'm super busy this week, but I hope to have time on Saturday, and I plan to get back to you.

I've recalled that I have this snippet in my private configuraton:

# Configure escape sequences for less so that it will know how to display
# colors for man etc. See also:
# http://boredzo.org/blog/archives/2016-08-15/colorized-man-pages-understood-and-customized
# https://linuxtidbits.wordpress.com/2009/03/23/less-colors-for-man-pages/
# http://stackoverflow.com/questions/34265221/how-to-colorize-man-page-in-fish-shell
man() {
	env \
		LESS_TERMCAP_mb=$(printf "\e[1;37m") \
		LESS_TERMCAP_md=$(printf "\e[1;37m") \
		LESS_TERMCAP_me=$(printf "\e[0m") \
		LESS_TERMCAP_se=$(printf "\e[0m") \
		LESS_TERMCAP_ue=$(printf "\e[0m") \
			man "$@"
}

What do you think about the result, @dngray ? I like how it's not too flashy but still makes the items stand out.

I guess that works if you like it to be monochrome. Mine looks prettier!

Maybe we could have "selenized-man" and "selenized-man-mono", what do you think? one thing I did notice is the background for LESS_TERMCAP_so does not show up if in a tty, with my configuration, but does for yours.

color-mono-both

Yeah, perhaps we can have two variants. Another option would be to use a less contrasting colors, e.g. blue and/or cyan (I just think that red is too strong, giving sort of "in your face" impression).

One think I definitely prefer in your version is status bar. :-)

Side note: I'll be away until Monday.

Another option would be to use a less contrasting colors, e.g. blue and/or cyan (I just think that red is too strong, giving sort of "in your face" impression).

What do you think of this?

tty_blue

Looks good in a tty too, ter-132n too.

One think I definitely prefer in your version is status bar. :-)

I am pretty happy with it, except for as you can see in the tty it doesn't show up.

Side note: I'll be away until Monday.

I'll keep that in mind

Blue version looks awesome!
Closed via #50. Thanks for your patience!