Created
May 7, 2010 15:24
-
-
Save dchest/393560 to your computer and use it in GitHub Desktop.
Some things from my .bash_profile
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
# Aliases | |
alias la="ls -a" | |
alias ll="ls -l" | |
# Show git branch | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1] /' | |
} | |
# Set the colored prompt. | |
CODE_RED=$'\[\033[0;31m\]' | |
CODE_GREEN=$'\[\033[0;32m\]' | |
CODE_YELL=$'\[\033[0;33m\]' | |
CODE_BLUE=$'\[\033[0;34m\]' | |
CODE_NORM=$'\[\033[m\]' | |
CODE_GRAY=$'\[\033[1;30m\]' | |
PRUSER="\u" | |
PRTERM=":\l " | |
PREXIT="${CODE_YELL}\$EXITCODE${CODE_NORM}" | |
PRPROMPT="$" | |
if [ "$EUID" = "0" ]; then | |
PRUSER="${CODE_RED}\u${CODE_NORM}" | |
PRPROMPT="${CODE_RED}#${CODE_NORM}"; | |
fi | |
TITLEBAR="\[\033]0;\w\007\]" | |
PSTRING=$PREXIT$TITLEBAR${CODE_GREEN}$PRPROMPT${CODE_NORM} | |
PS1="${CODE_GRAY}\w${CODE_YELL}\$(parse_git_branch) ${CODE_NORM}${TITLEBAR}${PSTRING} " | |
export PS1 | |
export CLICOLOR=1 | |
export EDITOR=/usr/bin/vim |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment