📜 ⬆️ ⬇️

We read manuals in color

Given that the Day of the system administrator only once a year, and I want to have more bright days, let's add some colors to the gray days of the valiant fighters of the invisible front! :)

A note was published in the Linux Journal on how to view manual pages (man) in color using most. I immediately tried the method presented and I liked the result - it became more fun to live! :) However, the lack of navigation was immediately revealed - Home and End did not work. To refuse the convenient browser less in favor of the most because the latter “understands” colors from the box? It is better to teach less “coloring” man-pages! The manual was seen on the Nico Golde blog . The recipe is simple: we add the following lines to the file ~ /.$ SHELLrc (for the majority that uses bash, it will be ~ / .bashrc):
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'

I hope this improves man’s readability! ;) See result .

PS Congratulations to all system administrators on their professional holiday!
')
PPS For radicals. :) The essence of the method with the use of the most is to set the most itself and declare the environment variable MANPAGER with the command export MANPAGER = "/ usr / bin / most -s" or in the file ~ / .profile

Source: https://habr.com/ru/post/65857/


All Articles