Last active
December 11, 2015 18:58
-
-
Save emperorcezar/4644924 to your computer and use it in GitHub Desktop.
My zshell setup
This file contains hidden or 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
export ARCHFLAGS="-arch x86_64" | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxCxDxBxegedabagacad | |
# Path to oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="kennethreitz" | |
COMPLETION_WAITING_DOTS="true" | |
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) | |
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ | |
# Example format: plugins=(rails git textmate ruby lighthouse) | |
plugins=(git mercurial autojump python github gnu-utils git-flow history-substring-search brew osx screen supervisor vagrant virtualenvwrapper) | |
source $ZSH/oh-my-zsh.sh | |
export PATH=/Applications/Postgres.app/Contents/MacOS/bin:/usr/local/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Applications/Postgres.app/Contents/MacOS/bin:/usr/local/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:~/git:/usr/local/sbin:/usr/local/go/bin:/Users/cezar/kindle/adt/sdk/platform-tools | |
# Setting PATH for Python 2.7 | |
export PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}" | |
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH | |
### Added by the Heroku Toolbelt | |
export PATH="/usr/local/heroku/bin:$PATH" | |
# autoenv setup | |
source /usr/local/Cellar/autoenv/0.1.0/activate.sh | |
# virtualenvwrapper | |
export WORKON_HOME=$HOME/.virtualenvs | |
export PROJECT_HOME=$HOME/code | |
source /usr/local/bin/virtualenvwrapper.sh | |
case "$TERM" in | |
'screen') | |
cd $SCREENPWD | |
;; | |
esac | |
SSHAGENT=/usr/bin/ssh-agent | |
SSHAGENTARGS="-s" | |
if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then | |
eval `$SSHAGENT $SSHAGENTARGS` | |
trap "kill $SSH_AGENT_PID" 0 | |
fi | |
# emacs to client | |
export ALTERNATE_EDITOR=emacs EDITOR=emacsclient VISUAL=emacsclient | |
# you can always use the command "emacs" instead of "emacsclient -c" | |
alias emacs='emacsclient -n' | |
# Aliases | |
sssh (){ ssh -t "$1" 'tmux attach || tmux new || screen -DR'; } | |
alias lg='git log --graph --full-history --all --color --pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s"' | |
alias gl="git log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
alias lf='ls -Gl | grep ^d' #Only list directories | |
alias lsd='ls -Gal | grep ^d' #Only list directories, including hidden ones | |
ft() { | |
find . -name "$2" -exec grep -il "$1" {} \; | |
} | |
startdev() { | |
# Try installing the requirements | |
# Only check this directory or the one above it | |
if [ -e ./requirements.txt ]; then | |
${VIRTUAL_ENV}/bin/pip install -r ./requirements.txt || true | |
elif [ -e ../requirements.txt ]; then | |
${VIRTUAL_ENV}/bin/pip install -r ../requirements.txt || true | |
fi | |
MANAGE=`find . -name 'manage.py'` | |
NUM_RESULTS=$(echo $MANAGE | wc -l) | |
if [ $NUM_RESULTS -eq 1 ]; then | |
MANAGE_DIR=$(dirname $MANAGE) | |
echo $MANAGE_DIR | |
DEBUG=True ${VIRTUAL_ENV}/bin/python ${MANAGE_DIR}/manage.py syncdb | |
DEBUG=True ${VIRTUAL_ENV}/bin/python ${MANAGE_DIR}/manage.py runserver_plus | |
else | |
echo "Found too many manage.py. exiting..." | |
return 1 | |
fi | |
} | |
alias server='DEBUG=True python ./manage.py runserver_plus' | |
# Hub for Git | |
alias git="hub" | |
# ssh agent forwarding | |
alias ssh="ssh -A" | |
alias screen='export SCREENPWD=$(pwd); /usr/bin/screen' | |
alias killpyc='find . -name "*.pyc" -exec rm -rf {} \;' | |
gka() { gitk --all $(git log -g --format="%h" -50) "$@"; }; | |
# include all the old bash stuff | |
if [ -e ~/.profile ]; then | |
source ~/.profile | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment