Skip to content

Instantly share code, notes, and snippets.

@bjgill
Created October 11, 2018 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjgill/49fa6b3ee15ed117d03b822d967f1751 to your computer and use it in GitHub Desktop.
Save bjgill/49fa6b3ee15ed117d03b822d967f1751 to your computer and use it in GitHub Desktop.
.bashrc
# I, for one, am ready to be polite to our new robot overlords.
eval $(thefuck --alias oops)
alias please=sudo
# Prompt with colors and git branch information
if [[ $(id -u -n) != "<username>" ]]; then
USERNAME_STRING='\[\033[0;32m\]\u'
else
USERNAME_STRING=''
fi
if [[ $(hostname) != "<hostname>" ]]; then
HOSTNAME_STRING='\[\033[0;31m\]\h r'
else
HOSTNAME_STRING=''
fi
GITBRANCH_COLOUR='\[\033[0;33m\]'
NC='\[\033[0m\]'
# The prompt itself
export PS1="[${USERNAME_STRING}${NC}@${HOSTNAME_STRING}${GITBRANCH_COLOUR}(\$(svn info 2>/dev/null | grep <home dir> | colrm 1 37)\$(git symbolic-ref --short HEAD 2> /dev/null)) ${NC}\W]\$ "
# Terminal tab title
export PROMPT_COMMAND='echo -ne "\033]0;${USERNAME_STRING}@${HOSTNAME_STRING}: ${PWD/$HOME/~}\007"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment