Created
October 21, 2017 14:15
-
-
Save TuxCoding/1ec91956cabb73f4f1a094ac0fb77e73 to your computer and use it in GitHub Desktop.
Colored man pages using less. This code snippet affects other parts of your like the normal less command. Source: https://unix.stackexchange.com/questions/119/colors-in-man-pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [[ -f ~/.less-colors ]] && . ~/.less-colors |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export LESS_TERMCAP_mb=$(tput bold; tput setaf 2) # green | |
| export LESS_TERMCAP_md=$(tput bold; tput setaf 6) # cyan | |
| export LESS_TERMCAP_me=$(tput sgr0) | |
| export LESS_TERMCAP_so=$(tput bold; tput setaf 3; tput setab 4) # yellow on blue | |
| export LESS_TERMCAP_se=$(tput rmso; tput sgr0) | |
| export LESS_TERMCAP_us=$(tput smul; tput bold; tput setaf 7) # white | |
| export LESS_TERMCAP_ue=$(tput rmul; tput sgr0) | |
| export LESS_TERMCAP_mr=$(tput rev) | |
| export LESS_TERMCAP_mh=$(tput dim) | |
| export LESS_TERMCAP_ZN=$(tput ssubm) | |
| export LESS_TERMCAP_ZV=$(tput rsubm) | |
| export LESS_TERMCAP_ZO=$(tput ssupm) | |
| export LESS_TERMCAP_ZW=$(tput rsupm) | |
| export GROFF_NO_SGR=1 # For Konsole and Gnome-terminal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [[ -f ~/.less-colors ]] && . ~/.less-colors |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment