Skip to content

Commit

Permalink
Support for man page color
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-j-lee committed May 25, 2020
1 parent d678d2b commit 6b95c91
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .less_env
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

# Reference: https://unix.stackexchange.com/questions/119/colors-in-man-pages

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
5 changes: 3 additions & 2 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,13 @@ alias mv="mv -i"
alias cp="cp -i"
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
export PATH="$PATH:$HOME/.local/bin"

export JAVA_HOME="/usr/lib/jvm/default"
source /usr/share/nvm/init-nvm.sh

eval "$(rbenv init -)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

[ -f ~/.less_env ] && source ~/.less_env

0 comments on commit 6b95c91

Please sign in to comment.