Created
March 14, 2014 16:34
-
-
Save endigo9740/9551370 to your computer and use it in GitHub Desktop.
.bash_profile (by Andrew)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###################################################################### | |
# Recolor Prompt and show current GIT Branch | |
###################################################################### | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
function reviseprompt { | |
local BLACK="\[\033[0;30m\]" | |
local BLACK_BOLD="\[\033[1;30m\]" | |
local RED="\[\033[0;31m\]" | |
local RED_BOLD="\[\033[1;31m\]" | |
local GREEN="\[\033[0;32m\]" | |
local GREEN_BOLD="\[\033[1;32m\]" | |
local YELLOW="\[\033[0;33m\]" | |
local YELLOW_BOLD="\[\033[1;33m\]" | |
local BLUE="\[\033[0;34m\]" | |
local BLUE_BOLD="\[\033[1;34m\]" | |
local CYAN="\[\033[0;36m\]" | |
local CYAN_BOLD="\[\033[1;36m\]" | |
local WHITE="\[\033[0;37m\]" | |
local WHITE_BOLD="\[\033[1;37m\]" | |
case $TERM in | |
xterm*) | |
TITLEBAR='\[\033]0;\u@\h:\w\007\]' | |
;; | |
*) | |
TITLEBAR="" | |
;; | |
esac | |
PS1="${TITLEBAR}\ | |
$WHITE[\$(date +%H:%M)]\ | |
$WHITE[$GREEN_BOLD\u:$CYAN\w$WHITE]$GREEN\$(parse_git_branch)\ | |
$WHITE\$ " | |
PS2='> ' | |
PS4='+ ' | |
} | |
reviseprompt | |
###################################################################### | |
# Alias's | |
###################################################################### | |
if [ -f ~/.bash_aliases ]; then | |
. ~/.bash_aliases | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment