PS1 ultimate prompt!

🙂  Screenshot from 2014-04-12 14:35:28 


parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
#COLON='33[00m\]:'
COLON=' '
TIME='33[01;31m\]\t'$COLON
USER='33[02;32m\]\u'$COLON
HOST='33[02;36m\]\h'$COLON'33[01;34m\]'
LOCATION='`pwd | sed "s#\(/[^/]\+/[^/]\+/[^/]\+/\).*\(/[^/]\+/[^/]\+\)/\?#\1...\2#g"`'
BRANCH=$COLON'33[00;33m\]$(parse_git_branch)\[33[00m\]\n\$ '
PS1=$TIME$USER$HOST$LOCATION$BRANCH

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s