[bash] colorize man pages
This commit is contained in:
parent
78e76c2390
commit
7ed625cebd
1 changed files with 18 additions and 0 deletions
18
bashrc
18
bashrc
|
@ -222,6 +222,24 @@ solarized() {
|
||||||
# Combined mkdir and cd
|
# Combined mkdir and cd
|
||||||
mkcd() { mkdir -p -- "$1" && cd -P -- "$1"; }
|
mkcd() { mkdir -p -- "$1" && cd -P -- "$1"; }
|
||||||
|
|
||||||
|
# Colorized `man`
|
||||||
|
man() {
|
||||||
|
if [ "$BACKGROUND" = "dark" ]; then
|
||||||
|
local standout="$base02;44" bold="$yellow" underline="$base3;4"
|
||||||
|
else
|
||||||
|
local standout="$base02;46" bold="$blue" underline="$base00;4"
|
||||||
|
fi
|
||||||
|
|
||||||
|
env \
|
||||||
|
LESS_TERMCAP_so=$(echo -ne "\e[${standout}m") \
|
||||||
|
LESS_TERMCAP_md=$(echo -ne "\e[${bold}m") \
|
||||||
|
LESS_TERMCAP_us=$(echo -ne "\e[${underline}m") \
|
||||||
|
LESS_TERMCAP_se=$'\e[0m' \
|
||||||
|
LESS_TERMCAP_me=$'\e[0m' \
|
||||||
|
LESS_TERMCAP_ue=$'\e[0m' \
|
||||||
|
man "$@"
|
||||||
|
}
|
||||||
|
|
||||||
# Apply customizations
|
# Apply customizations
|
||||||
bashrc_customize_environment
|
bashrc_customize_environment
|
||||||
bashrc_customize_shell_options
|
bashrc_customize_shell_options
|
||||||
|
|
Loading…
Add table
Reference in a new issue