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[1;44;33m") \ | |
LESS_TERMCAP_ue=$(printf "\e[0m") \ | |
LESS_TERMCAP_us=$(printf "\e[1;32m") \ | |
man "$@" | |
} |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
mjm
commented
Aug 15, 2016
If you use fish: 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[1;44;33m") \
LESS_TERMCAP_ue=(printf "\e[0m") \
LESS_TERMCAP_us=(printf "\e[1;32m") \
man $argv
end |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
dentex
commented
Aug 16, 2016
Awesome! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
michaelmhoffman
Aug 16, 2016
In bash, I remove the env
at the beginning and use command man "$@"
at the end instead. This avoids an extra call to env
.
michaelmhoffman
commented
Aug 16, 2016
In bash, I remove the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
koleksiuk
Aug 16, 2016
If you use fish, it's better to set this in config
http://askubuntu.com/questions/522599/how-to-get-color-man-pages-under-fish-shell
koleksiuk
commented
Aug 16, 2016
If you use fish, it's better to set this in config http://askubuntu.com/questions/522599/how-to-get-color-man-pages-under-fish-shell |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
radik909
commented
Aug 16, 2016
Awesome |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
jhermann
Aug 16, 2016
Shorter… (no printf calls)
man() {
LESS_TERMCAP_mb=$'\e'"[1;31m" \
LESS_TERMCAP_md=$'\e'"[1;31m" \
LESS_TERMCAP_me=$'\e'"[0m" \
LESS_TERMCAP_se=$'\e'"[0m" \
LESS_TERMCAP_so=$'\e'"[1;44;33m" \
LESS_TERMCAP_ue=$'\e'"[0m" \
LESS_TERMCAP_us=$'\e'"[1;32m" \
command man "$@"
}
jhermann
commented
Aug 16, 2016
Shorter… (no printf calls) man() {
LESS_TERMCAP_mb=$'\e'"[1;31m" \
LESS_TERMCAP_md=$'\e'"[1;31m" \
LESS_TERMCAP_me=$'\e'"[0m" \
LESS_TERMCAP_se=$'\e'"[0m" \
LESS_TERMCAP_so=$'\e'"[1;44;33m" \
LESS_TERMCAP_ue=$'\e'"[0m" \
LESS_TERMCAP_us=$'\e'"[1;32m" \
command man "$@"
} |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
carpe171
commented
Aug 16, 2016
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
kenwilcox
Aug 18, 2016
or you can add the following to your ~/.profile and not override default commands - they're just environment variables anyway
export LESS_TERMCAP_mb=$'\e'"[1;31m"
export LESS_TERMCAP_md=$'\e'"[1;31m"
export LESS_TERMCAP_me=$'\e'"[0m"
export LESS_TERMCAP_se=$'\e'"[0m"
export LESS_TERMCAP_so=$'\e'"[1;44;33m"
export LESS_TERMCAP_ue=$'\e'"[0m"
export LESS_TERMCAP_us=$'\e'"[1;32m"
kenwilcox
commented
Aug 18, 2016
or you can add the following to your ~/.profile and not override default commands - they're just environment variables anyway export LESS_TERMCAP_mb=$'\e'"[1;31m" |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
forkbomber
Aug 19, 2016
If you are using oh-my-zsh – you can achieve the same via colored-man-pages
plugin: https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/colored-man-pages/colored-man-pages.plugin.zsh
forkbomber
commented
Aug 19, 2016
If you are using oh-my-zsh – you can achieve the same via |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
Fale
commented
Aug 21, 2016
I've just tried on Fedora, and it seems not to work :( |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
not-a-hacker
Aug 22, 2016
Tnx @forkbomber!! I totally missed this when looking over oh-my-zsh plugins.
not-a-hacker
commented
Aug 22, 2016
Tnx @forkbomber!! I totally missed this when looking over oh-my-zsh plugins. |
If you use fish: