-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path_bashrc
135 lines (105 loc) · 3.61 KB
/
_bashrc
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
128
129
130
131
132
133
134
135
# 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