Created
October 27, 2012 00:08
-
-
Save erickgnavar/3962340 to your computer and use it in GitHub Desktop.
bash config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#link selenium | |
alias selenium-server="java -jar /usr/local/Cellar/selenium-server-standalone/2.25.0/selenium-server-standalone-2.25.0.jar" | |
#Python-Mysql | |
function fix_mysql_python() { | |
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib | |
} | |
#fix git in mac to select updated git version | |
export PATH=/usr/local/bin:/usr/local/mysql/bin:$PATH | |
#Mongo in macbook | |
alias manage="python manage.py" | |
alias mongod="mongod --dbpath /data/db/" | |
alias grep="grep --color=auto" | |
#Sublime | |
function find_word() { | |
if [ $1 ]; then | |
find . -type f -name "*.py" -exec grep --color=always -nH "$1" {} \; | |
else | |
echo "Enter a word"; | |
fi | |
} | |
function source() { | |
command source "$@"; | |
update_prompt | |
} | |
alias asadmin="/usr/local/Cellar/glassfish/3.1.2/bin/asadmin"; | |
alias venv="source ../venv/bin/activate"; | |
os=`uname` | |
if [ $os == "Darwin" ]; then | |
#Sublime shortcut | |
function sublime() { | |
if [ $1 ]; then | |
open $1 -a "sublime text 2"; | |
else | |
echo "Enter a valid input"; | |
fi | |
} | |
#Sourcetree | |
function sourcetree() { | |
if [ $1 ]; then | |
open $1 -a "SourceTree"; | |
else | |
echo "Enter a valid input"; | |
fi | |
} | |
#Alias | |
alias hideDesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"; | |
alias showDesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"; | |
alias showHiddenFiles="defaults write com.apple.Finder AppleShowAllFiles YES && killall Finder"; | |
alias hideHiddenFiles="defaults write com.apple.Finder AppleShowAllFiles NO && killall Finder"; | |
fi | |
#Fix django problem | |
export LANG="en_US.UTF-8" | |
export LC_COLLATE="en_US.UTF-8" | |
export LC_CTYPE="en_US.UTF-8" | |
export LC_MESSAGES="en_US.UTF-8" | |
export LC_MONETARY="en_US.UTF-8" | |
export LC_NUMERIC="en_US.UTF-8" | |
export LC_TIME="en_US.UTF-8" | |
export LC_ALL= | |
#Set color to terminal | |
export CLICOLOR=1 | |
export LSCOLORS=GxFxCxDxBxegedabagaced | |
function git () { | |
command git "$@" | |
if [ $1 == "checkout" ]; then | |
update_prompt | |
fi | |
} | |
function cd () { | |
command cd "$@" | |
update_prompt | |
} | |
export BRANCH="" | |
function print_branch() { | |
branch=`git branch 2>/dev/null | grep '*' | awk '{print $2}'` | |
c=`echo "${#branch}"` | |
if [ $c != 0 ]; then | |
export BRANCH="[git:$branch]"; | |
else | |
export BRANCH="" | |
fi | |
} | |
function update_prompt () { | |
print_branch | |
export PS1="$(virtualenv_info)$USER$AT$HOST: $MAGENTA$(get_pwd) $WHITE$BRANCH $DOLLAR\n$WHITE → $RESET" | |
} | |
function virtualenv_info () { | |
[ $VIRTUAL_ENV ] && echo "("`basename $VIRTUAL_ENV`") "; | |
} | |
function get_pwd() { | |
echo "${PWD/$HOME/~}" | |
} | |
#COLORS | |
RESET="\[\033[0m\]" | |
BLACK="\[\033[30m\]" | |
RED="\[\033[31m\]" | |
GREEN="\[\033[32m\]" | |
YELLOW="\[\033[33m\]" | |
BLUE="\[\033[34m\]" | |
MAGENTA="\[\033[35m\]" | |
CYAN="\[\033[36m\]" | |
WHITE="\[\033[37m\]" | |
#set color to prompt | |
USER="$RED\u" | |
HOST="$YELLOW\h" | |
DOLLAR="$CYAN\$ $RESET" | |
AT="$WHITE at " | |
update_prompt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment