Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
136 lines (105 sloc) 3.61 KB
# vim: ft=sh
# shortcuts
alias ls='ls -G'
alias ll='ls -hl'
alias l='ls -l'
alias lla='ls -ahl'
alias ..='cd ..'
alias mkdir='mkdir -pv'
alias ql='qlmanage -p'
# go to actual directory when CDing into a symlink
set -P
# shortcut for finding a keyword in files
# (uses Ag or Ack depending on what's available)
if hash ag 2>/dev/null; then
function f {
ag -i "$@"
}
else
function f {
ack "$@"
}
fi
# find a file by a certain name quickly
function s { find . -name $@;}
# get stats for a domain
function fs { ping -o "$1" | grep "$1" | grep -v statistics; }
# remove all .pyc files under current directory and subdirectories
function clean_pyc { find . -name "*.pyc" -delete;}
# go to a reference project
function goto { cd `cd ${HOME}/ref/$1 && pwd -P`; }
_goto_complete () {
local cur="$2"
COMPREPLY=( $(goto && compgen -d -- "${cur}" ) )
}
complete -o nospace -F _goto_complete -S/ goto
# quick http server for current directory
server() {
python -m SimpleHTTPServer $1
}
# pip should only run if there is a virtualenv currently activated
export PIP_REQUIRE_VIRTUALENV=true
# but in case we want to install a global pip package, use gpip
gpip(){
PIP_REQUIRE_VIRTUALENV="" pip "$@"
}
# pythonbrew stuff
[[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc
export PYTHONPATH="$PYTHONPATH:/Library/Python/2.7/site-packages/:${HOME}/dotfiles/utilities/:${HOME}/tools/:${HOME}/tools/django-debug-toolbar/"
# using powerline for nice prompt (custom powerline prompt below to add newlines)
if [ -f /Library/Python/2.7/site-packages/powerline/bindings/bash/powerline.sh ]; then
export POWERLINE_SRC=/Library/Python/2.7/site-packages/powerline
else
export POWERLINE_SRC=/usr/local/lib/python2.7/site-packages/powerline
fi
. ${POWERLINE_SRC}/bindings/bash/powerline.sh
if [[ -n "$VIMRUNTIME" ]]; then
export POWERLINE_VIM_SHELL_INDICATOR='vim'
fi
. ${POWERLINE_SRC}/bindings/bash/powerline.sh
# Env variables and functions for virtualenvwrapper.
# virtualenv must be loaded after pythonbrew
export WORKON_HOME=$HOME/dev/virtualenvs
export PROJECT_HOME=$HOME/dev/projects
if [ -f $HOME/.pythonbrew/pythons/Python-2.7.2/bin/virtualenvwrapper.sh ]; then
. $HOME/.pythonbrew/pythons/Python-2.7.2/bin/virtualenvwrapper.sh
else
. /usr/local/bin/virtualenvwrapper.sh
fi
### Added by the Heroku Toolbelt
export PATH="/usr/local/php5/bin:/usr/local/heroku/bin:$HOME/local/bin:$HOME/.local/bin:$PATH"
# add django tools
if [ -f ~/dev/src/django-current/extras/django_bash_completion ]; then
. ~/dev/src/django-current/extras/django_bash_completion
fi
# add git autocompletion
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
# add tmuxinator autocompletion
if [ -f ~/dotfiles/utilities/bin/tmuxinator.bash ]; then
. ~/dotfiles/utilities/bin/tmuxinator.bash
fi
# add sack utility
if [ -f ~/dotfiles/sack/sack.zsh ]; then
. ~/dotfiles/sack/sack.zsh
fi
# Bash shell driver for 'go' (http://code.google.com/p/go-tool/).
#function go {
# export GO_SHELL_SCRIPT=$HOME/.__tmp_go.sh
# python -m go $*
# if [ -f $GO_SHELL_SCRIPT ] ; then
# source $GO_SHELL_SCRIPT
# fi
# unset GO_SHELL_SCRIPT
#}
[[ -d $HOME/dev/src/gocode ]] && export GOPATH=$GOPATH:$HOME/dev/src/gocode
if [ -f $HOME/tools/projects.sh ] ; then
source $HOME/tools/projects.sh
fi
if [ -f $HOME/dotfiles/_configs/shellcolors/base16-eighties.dark.sh ] ; then
source $HOME/dotfiles/_configs/shellcolors/base16-eighties.dark.sh
fi
# what other editor could you possible want to use?
export EDITOR='vim'
PATH=$HOME/dotfiles/sack:$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting