Skip to content

Instantly share code, notes, and snippets.

@brennancheung
Created January 5, 2016 05:35
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 brennancheung/b525346212f2d582ec9d to your computer and use it in GitHub Desktop.
Save brennancheung/b525346212f2d582ec9d to your computer and use it in GitHub Desktop.
nifty .bash_profile settings
alias ll="ls -lGh"
alias ls="ls -Gh"
alias p="ping google.com"
alias ss="python -m SimpleHTTPServer 3000"
alias gst="git status"
alias gc="git checkout"
alias gd="git diff"
mkcd() { mkdir -p "$@" && cd "$_"; }
function color_my_prompt {
local __user_and_host="\[\033[01;32m\]\u@\h"
local __cur_location="\[\033[01;34m\]\w"
local __git_branch_color="\[\033[31m\]"
#local __git_branch="\`ruby -e \"print (%x{git branch 2> /dev/null}.grep(/^\*/).first || '').gsub(/^\* (.+)$/, '(\1) ')\"\`"
local __git_branch='`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\ /`'
local __prompt_tail="\[\033[35m\]$"
local __last_color="\[\033[00m\]"
export PS1="$__user_and_host $__cur_location $__git_branch_color$__git_branch $__prompt_tail$__last_color "
}
color_my_prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment