Skip to content

Instantly share code, notes, and snippets.

@mmailhos
Forked from supermarin/.env
Created April 11, 2019 12:19
Show Gist options
  • Save mmailhos/b4d30f8dffa6aab6d6b54021691daba0 to your computer and use it in GitHub Desktop.
Save mmailhos/b4d30f8dffa6aab6d6b54021691daba0 to your computer and use it in GitHub Desktop.
Colored `man` pages on OSX
# ZSH / BASH users
# Add this to your .env, .bashrc, .zshrc, or whatever file you're using for environment
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 "$@"
}
# Fish users
# Save this file as ~/.config/fish/functions/man.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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment