forked from gvaughn/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbash_profile
More file actions
134 lines (119 loc) · 3.9 KB
/
bash_profile
File metadata and controls
134 lines (119 loc) · 3.9 KB
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
#stop hiding Library folder, Apple
chflags nohidden ~/Library
# case insensitive bash filename completion
shopt -s nocaseglob
# Bypass use of .inputrc with 'bind' syntax
bind "set completion-ignore-case on"
bind "set show-all-if-ambiguous on"
bind "set show-all-if-unmodified on"
bind "set visible-stats on"
# git goodies
PS1='\[\033[G\][\u@\h \W$(__git_ps1 " (%s)")]\$ '
#export GIT_AUTHOR_EMAIL=greg.vaughn@livingsocial.com
# let's use hub for all my git needs
eval "$(hub alias -s)"
export GREP_OPTIONS='--color=auto'
export LESS='-iMRXFfx4'
#export VISUAL='mvim'
export EDITOR='vim'
# make man colorful
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking
export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold
export LESS_TERMCAP_me=$'\E[0m' # end mode
export LESS_TERMCAP_se=$'\E[0m' # end standout-mode
export LESS_TERMCAP_so=$'\E[1;31m' # begin standout-mode - info box
export LESS_TERMCAP_ue=$'\E[0m' # end underline
export LESS_TERMCAP_us=$'\E[04;33;5;146m' # begin underline
# brew install bash-completion for this to work
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
#
# Call git checkout and load rvmrc
# useful when diff branches have diff rubies/gemsets
#
#gco()
#{
# git checkout $*
# if [[ -s .rvmrc ]] ; then
# unset rvm_rvmrc_cwd
# cd .
# fi
#}
# History: don't store duplicates
export HISTCONTROL=erasedups
# History: 10,000 entries
export HISTSIZE=10000
# e: exit without q at end, r: color codes, X: leave results in buffer
export LESS="-erX"
# control Terminal.app tab names
function tabname {
printf "\e]1;$1\a"
}
function winname {
printf "\e]2;$1\a"
}
#export CC=/usr/bin/gcc-4.2 #makes rvm install ree happy
export RUBYOPT=-Itest # so we can just invoke ruby test/unit/foo.rb
export PATH=/usr/local/bin:/usr/local/sbin:~/bin:/usr/local/mysql/bin:$PATH
# so bundle open {gemname} works
export BUNDLER_EDITOR=v
alias vim='mvim -v'
alias ls='ls -aFGh'
alias ll='ls -lah'
alias flush='echo "flush_all" | nc localhost 11211'
alias raket='USE_TURN=true time rake | grep -v PASS; growlnotify -s -m "Rake tests: DONE"'
alias update_submodules='git pull --recurse-submodules && git submodule update'
#alias foreman_no_web="foreman start -c $(ruby -e 'print (File.read("./Procfile").scan(/^(\w+):/).flatten - ["web"]).join("=1,") + "=1"')"
alias pow_restart='touch ~/.pow/ls/tmp/restart.txt'
alias mdns_restart='sudo killall -HUP mDNSResponder'
alias gemkill='gem list | cut -d" " -f1 | xargs gem uninstall -aIx'
alias bl='bundle --local'
alias ri='ri -f ansi'
alias rc='test -e script/console && bundle exec script/console "$@" || bundle exec rails console "$@"'
#alias iex='rlwrap -a -H "/Users/enduser/.iex_history" -c -D 2 -r iex'
alias iex='rlwrap -H "/Users/enduser/.iex_history" -c -D 2 -r iex'
alias port_holder='sudo lsof -i -P | grep -i "listen"'
# Now trying rbenv-binstubs instead https://github.com/ianheggie/rbenv-binstubs
# no need to prefix bin/rake etc. in a bundle'd project
#BUNDLED_COMMANDS="foreman rackup rails rake rspec ruby shotgun spec watchr nesta cap"
#
### Functions
#
#bundler-installed()
#{
# which bundle > /dev/null 2>&1
#}
#
#within-bundled-project()
#{
# local dir="$(pwd)"
# while [ "$(dirname $dir)" != "/" ]; do
# [ -f "$dir/Gemfile" ] && return
# dir="$(dirname $dir)"
# done
# false
#}
#
#run-with-bundler()
#{
# local command="$1"
# shift
# if bundler-installed && within-bundled-project; then
# bundle exec $command $*
# else
# $command $*
# fi
#}
#
### Main program
#
#for CMD in $BUNDLED_COMMANDS; do
# alias $CMD="run-with-bundler $CMD"
#done
#RVM goodies
#[[ -s /Users/enduser/.rvm/scripts/rvm ]] && source /Users/enduser/.rvm/scripts/rvm # This loads RVM into a shell session.
# rbenv goodies
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
# Local host-only additions
[[ -s ~/.local_bash_profile ]] && source ~/.local_bash_profile