My favoriate two tools git and vim look good in colorful mode like syntax highlight or colored diff. You can put "almost unlimited" 256 different information in your terminal and which is huge. Well, using all 256 colors at once is not so useful, but I'd like to share my two coloring configurations.
1. Display git branche name in color
Using git means you would have a lot of branches in your working repo. And the git-completion.bash is the magic which allows you to use Tab key to complete name of branches, git sub commands and so on. I've added a little spice to PS1 environment value to display a branch name more clearly. Add these lines in to your ~/.bashrc:
if [ -f $HOME/bin/git-completion.bash ] && ! shopt -oq posix; then
. $HOME/bin/git-completion.bash
PS1='\[\033[1;35m\]\u: \[\033[0m\]\W\[\033[1;32m\]$(__git_ps1 " %s")\[\033[0m\] \$ '
fi
And you'll get this.
Now, you won't get lost in tens of thousands branches. Btw, I'm using Inconsolata dz font in iTerm2.
2. Less Colors for man Pages
As looking for a way to coloring with git-completions.bash, somehow I came up with this page explaining how to display colored text in man pages.
# Less Colors for Man Pages
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking
export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold
export LESS_TERMCAP_me=$'\E[0m' # end mode
export LESS_TERMCAP_se=$'\E[0m' # end standout-mode
export LESS_TERMCAP_so=$'\E[38;5;246m' # begin standout-mode - info box
export LESS_TERMCAP_ue=$'\E[0m' # end underline
export LESS_TERMCAP_us=$'\E[04;38;5;146m' # begin underline
After putting these into .bashrc, I got these from man and Python online help:
Neat.
Photo Credit: http://www.flickr.com/photos/bwaters23/4894078408/ Ban Pong Coloring by bwaters23



Recent Comments