Skip to content

Instantly share code, notes, and snippets.

@dougc84
Created October 9, 2012 15:21
Show Gist options
  • Save dougc84/3859483 to your computer and use it in GitHub Desktop.
Save dougc84/3859483 to your computer and use it in GitHub Desktop.
Command Prompt Fun
# terminal colors
export CLICOLOR=1
# vars
# ... omitted ...
# aliases
alias l='ls -lashF' # ' --color=always'
alias be='bundle exec'
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
# woman - man pages with preview.
function woman {
man -t "${1}" | open -f -a /Applications/Preview.app/
}
# color time!
# e=`printf "\033"`
e=`printf "\[\e"`
nothing=""
# end="$e[0m"
end="$e[m\]"
red="$e[1;31m"
green="$e[1;32m"
yellow="$e[1;33m"
blue="$e[1;34m"
magenta="$e[1;35m"
darkcyan="$e[36m"
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1="${green}[${end}\$(~/.rvm/bin/rvm-prompt)${green}]${end} ${magenta}\$(parse_git_branch)${end} \w $ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment