-
Notifications
You must be signed in to change notification settings - Fork 0
/
bashrc_mac
195 lines (153 loc) · 5.15 KB
/
bashrc_mac
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
export ARCH=$(uname -s)
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# ... and ignore same sucessive entries.
export HISTCONTROL=ignoreboth
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
;;
*)
;;
esac
# Alias definitions.
# enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ]; then
if [[ `which dircolors` != "" ]]; then
eval "`dircolors -b`"
fi
if [ $ARCH != "Linux" ]; then
# alias vi='vim' # SOME CUNTS HAVE FORCED THEIR OWN VIMRC ON PIVOTAL BOXES
alias vi='nvim' # SOME CUNTS HAVE FORCED THEIR OWN VIMRC ON PIVOTAL BOXES
alias ls='ls -G'
else
alias ls='ls --color=auto'
fi
alias grep='grep --color=auto'
fi
# Determine whether working at work or remotely, LOCATION used
# in the rest of the alias scripts
if [ -f /home/esaunder/scripts_openbet/get_location ]; then
export LOCATION=$(/home/esaunder/scripts_openbet/get_location)
fi
# Source alias files
if [ -f /home/esaunder/scripts_openbet/ob_aliases ]; then
source /home/esaunder/scripts_openbet/ob_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ]; then
source /etc/bash_completion
fi
# Necessary
export EDITOR=vim
export EXINIT="set notimeout"
# Basic path
# PATH=""
path_items=(
./bin
# $HOME/.rvm/bin
# $HOME/bin
# /usr/bin
# /usr/sbin
# /bin
# /usr/games
$HOME/scripts
# /user/sbin
# /usr/local/bin
# $HOME/perl5/bin
)
for i in ${path_items[@]}
do
PATH=$PATH:$i
done
export PATH
# OB specific setup
if [ -f $HOME/.openbet_env.bashrc ]; then
source $HOME/.openbet_env.bashrc
fi
# noths specific setup
if [ -f $HOME/scripts_noths/noths.bashrc ]; then
source $HOME/scripts_noths/noths.bashrc
fi
# twistilled specific setup
if [ -f $HOME/scripts_twistilled/twistilled.bashrc ]; then
source $HOME/scripts_twistilled/twistilled.bashrc
fi
# reevoo specific setup
if [ -f $HOME/scripts_reevoo/reevoo.bashrc ]; then
source $HOME/scripts_reevoo/reevoo.bashrc
fi
# [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
# Mac stupid overrides
source "$HOME/scripts/git-completion.bash"
# Load in the git branch prompt script
# This is used in the PS1
source ~/scripts/set_prompt_status_mac.sh
# This will add up/down arrows and show untracked files
export GIT_PS1_SHOWDIRTYSTATE="auto"
export GIT_PS1_SHOWUPSTREAM=1
export GIT_PS1_SHOWUNTRACKEDFILES=1
export GIT_PS1_SHOWCOLORHINTS=1
export PROMPT_COMMAND='__git_ps1 "\[\033[0;36m\]\t\[\033[0;33m\]@\[\033[0;32m\]\w\[\e[0m\]" "\[\033[33m\]:> \[\e[0m\]"'
alias rs="bundle exec rspec -c --format=doc"
alias rc="bundle exec cucumber "
alias zs="zeus rspec -c --format=doc"
alias ss="script/single_spec -c --format=doc"
# Shorter git aliases, because those keystrokes matter...
alias ga="git add"
alias gc="git commit"
alias gco="git checkout"
alias gs="git status"
alias gf="git fetch"
alias gd="git diff"
# Alias nexus mounting - see http://askubuntu.com/questions/207569/how-do-i-connect-a-nexus-7-to-transfer-files
# for more details
function android-connect () {
echo "Connecting as sudo to /media/GalaxyNexus ..."
sudo mtpfs -o allow_other /media/GalaxyNexus
echo "Done!"
}
function android-disconnect () {
echo "Disconnecting /media/GalaxyNexus..."
sudo fusermount -u /media/GalaxyNexus
echo "Done!"
}
# Shit I need for ack for some reason
export PERL5LIB=/home/esaunder/perl5/lib/perl5
# PATH=$PATH:/usr/share/ruby-rvm/bin # Add RVM to PATH for scripting
# PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
PERL_MB_OPT="--install_base \"/home/esaunder/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/home/esaunder/perl5"; export PERL_MM_OPT;
### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"
# This is to allow homebrew to span github I think
export HOMEBREW_GITHUB_API_TOKEN=fc1fd53bcb907c2e26cd793ed70f5e52d7b7b7f9
# rbenv setup required here
eval "$(rbenv init -)"
# Add ssh key for deploying to staging servers
ssh-add ~/.ssh/id_rsa > /dev/null 2>&1
# Because awesome
eval $(thefuck --alias)
# AWS autocomplete
complete -C aws_completer aws
# Victor has told me that nodenv is better, so forget about nvm
# export NVM_DIR="/Users/edsaunders/.nvm"
# [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
eval "$(nodenv init -)"