Last active
March 17, 2016 22:46
-
-
Save yrevar/0a8b9981025e340395f4 to your computer and use it in GitHub Desktop.
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
export PATH=$PATH:/$HOME/bin | |
if [ -z ${DISPLAY} ] | |
then | |
export DISPLAY=:0.0 | |
fi | |
# Terminal history settings | |
export HISTCONTROL=ignoredups:erasedups # no duplicate entries | |
export HISTSIZE=1000000 # big big history | |
export HISTFILESIZE=1000000 # big big history | |
shopt -s histappend # append to history, don't overwrite it | |
# Homebrew | |
export PATH=/usr/local/bin:/usr/local/sbin:$PATH | |
# Better command history search. Just copying won't work, be sure to read http://www.macworld.com/article/1146015/os-x/termhistory.html | |
bind '"^[[A":history-search-backward' | |
bind '"^[[B":history-search-forward' | |
alias setJdk6='export JAVA_HOME=$(/usr/libexec/java_home -v 1.6)' | |
alias setJdk7='export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)' | |
alias setJdk8='export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)' | |
alias prompt_full='export PS1="\u@\h\w $ "' | |
export PS1="\u @ \W $ " | |
# pip should only run if there is a virtualenv currently activated | |
export PIP_REQUIRE_VIRTUALENV=true | |
gpip(){ | |
PIP_REQUIRE_VIRTUALENV="" pip "$@" | |
} | |
# you can set your preferred virtual environment directort here | |
PY_VIRTUALENV_HOME="$HOME/virtualenvs/" | |
pyenv_list(){ | |
ls $PY_VIRTUALENV_HOME | |
} | |
pyenv_activate(){ | |
export PY_VIRTUALENV_PATH=$PY_VIRTUALENV_HOME/"$@" | |
source $PY_VIRTUALENV_PATH/bin/activate | |
} | |
# Working with Matplotlib in Virtual environments: http://matplotlib.org/faq/virtualenv_faq.html | |
function frameworkpython { | |
if [[ ! -z "$PY_VIRTUALENV_PATH" ]]; then | |
PYTHONHOME=$PY_VIRTUALENV_PATH /usr/local/bin/python "$@" | |
else | |
/usr/local/bin/python "$@" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: This article assumes you have installed virtualenv (pip install virtualenv).
Usage: