public
Last active

.bash_profile as of 2013/07/25

  • Download Gist
.bash_profile
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
# export PATH=~/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:wp-cli($HOME/.composer/bin)
# export PATH=~/bin:/usr/local/share/npm/bin:/usr/local/share/npm/lib/node_modules/grunt:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$HOME/.composer/bin
export ZGTC_OTHER="$HOME/.composer/bin"
export PATH="$PATH:$ZGTC_OTHER"
export ZGTC_GRUNT="/usr/local/share/npm/lib/node_modules/grunt-cli/bin/grunt"
export PATH="$ZGTC_GRUNT:$PATH"
export ZGTC_NPM="/usr/local/share/npm/bin"
export PATH="$ZGTC_NPM:$PATH"
export ZGTC_BIN="~/bin"
export PATH="$ZGTC_BIN:$PATH"
export homebrew="/usr/local/bin:/usr/local/sbin"
export PATH="$homebrew:$PATH"
 
 
 
export RBENV_ROOT=/usr/local/var/rbenv
# [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
 
# Wordpress-cli
export WP_CLI_PHP=/Applications/MAMP/bin/php/php5.3.20/bin/php
 
# print rvm, git branch, git status to the prompt, by emili parreƱo @eparreno
show_rvm_version() {
local gemset=$(echo $GEM_HOME | awk -F'@' '{print $2}')
[ "$gemset" != "" ] && gemset="@$gemset"
local version=$(echo $MY_RUBY_HOME | awk -F'-' '{print $2}')
[ "$version" != "" ] && version="$version"
local full="$version$gemset"
[ "$full" != "" ] && echo "$full"
}
 
show_git_dirty() {
local git_status=$(git status 2>&1 | tail -n1)
[[ $git_status != "fatal: Not a git repository (or any of the parent directories): .git" ]] && [[ $git_status != "nothing to commit (working directory clean)" ]] && echo " *"
}
 
show_git_branch() {
_branch="$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')"
test -n "$_branch" && echo -e " $_branch"
}
 
show_dev_info() {
echo "($(show_rvm_version)$(show_git_branch)$(show_git_dirty))"
}
 
# bash_completion
if [[ -s "/usr/local/Cellar/git/1.7.3.2/etc/bash_completion.d/git-completion.bash" ]]; then
source "/usr/local/Cellar/git/1.7.3.2/etc/bash_completion.d/git-completion.bash"
fi
 
# WP-CLI Bash completions
source $HOME/.composer/vendor/wp-cli/wp-cli/utils/wp-completion.bash
 
# rvm
#if [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
# source "$HOME/.rvm/scripts/rvm"
#fi
 
# node
#if [[ -s "/usr/local/share/npm/bin" ]]; then
# source "/usr/local/share/npm/bin"
#fi
 
# Colors
Black='\e[0;30m'
Red='\e[0;31m'
Green='\e[0;32m'
Yellow='\e[0;33m'
Blue='\e[0;34m'
Purple='\e[0;35m'
Cyan='\e[0;36m'
White='\e[0;37m'
 
# set the PS1 variable
#export PS1="\w\[\e[0;33;49m\]\$(parse_git_branch)\[\e[0;0m\]$ "
#export PS1="\e[0;33m\w\$(show_git_branch)\[\e[0;0m\]$ "
#export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[01;33m\] $(show_git_branch)$(show_git_dirty)\[\033[01;34m\] \$\[\033[00m\] '
 
#export PS1="\[$Cyan\]\w \[$Yellow\]\$(show_dev_info)\[$White\]$ "
export PS1="\[$Green\]\w \[$Yellow\]\$(show_dev_info)\[$Black\]$ "
 
 
# PostgreSQL
#alias pgstart="pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start"
#alias pgstop="pg_ctl -D /usr/local/var/postgres stop -s -m fast"
#alias pglog="tail -n 100 /usr/local/var/postgres/server.log"
 
export EDITOR="subl -w"
 
 
## ALIASES
# paths
alias myapache='cd /opt/local/apache2/htdocs/cake'
alias projectes='cd ~/Documents/docs\ sergi/webs/projectes/'
# console
alias cl="clear"
alias sh="subl /etc/hosts"
alias s="subl ."
alias cw="compass watch"
# git
alias gi="git init"
alias gs="git status"
#alias gl="git log --oneline --abbrev-commit --decorate --color"
alias gl="git log --graph --pretty=format:'%Cgreen%h%Creset -%Creset %s%C(yellow)%d %Cblue(%aN, %cr)%Creset' --abbrev-commit --date=relative"
alias gall="git add ."
alias gam="git commit -am"
alias gf="git fetch"
alias gp="git pull"
alias gpom="git push origin master"
alias gphm="git push heroku master"
alias gpwm="git push web master"
alias gc="git checkout"
alias gb="git branch"
alias gy="git log --oneline --abbrev-commit --decorate --color --since=yesterday"
alias gw="git log --oneline --abbrev-commit --decorate --color --since=1.week"
alias gg="git log --oneline --abbrev-commit --branches=* --graph --decorate --color"
#svn
alias sc='svn ci -m '
alias sp="svn up"
#mysqldump/mysql from MAMP
#alias mysqldump="/Applications/MAMP/Library/bin/mysqldump"
# best: sudo ln -s /Applications/MAMP/Library/bin/mysqldump /usr/local/bin/mysqldump
 
# show folder name in terminal tab
# http://superuser.com/questions/79972/set-the-title-of-the-terminal-window-to-the-current-directory
# Unicode chars not supported
PROMPT_COMMAND='echo -ne "\033]0; ${PWD##*/}\007"'

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.