Skip to content

Instantly share code, notes, and snippets.

@florapdx
Created February 6, 2016 04:41
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 florapdx/379000692be7b11aad1d to your computer and use it in GitHub Desktop.
Save florapdx/379000692be7b11aad1d to your computer and use it in GitHub Desktop.
basic prompt configs
## Environment customizations
# Add Sublime Text 2 as default editor
export EDITOR="/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
## Alias cd up-level
alias cd..="cd .."
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ......="cd ../../../../.."
## PS1 Prompt customizations:
function parse_git_branch() {
x=`git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'`
if [[ "$x" == "" ]]; then
echo ""
else
echo "$x "
fi
}
export PROMPT_COMMAND='export OLD_STATUS=$?'
export PS1='\[\033[1;35m\]\h \[\033[0;30m\]\d \[\033[0;30m\]\A \[\033[1;30m\]\W \[\033[0;30m\]`parse_git_branch` \[\033[0;30m\]`if [ $OLD_STATUS = 0 ]; then echo \♡; else echo \♥; fi` \[\033[1;33m\]\$ \[\033[0m\]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment