forked from claytron/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.commonenv
149 lines (130 loc) · 3.75 KB
/
.commonenv
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
UNAME=$(uname)
source $HOME/.commonfuncs
# let's set a proper PATH
#########################
# This is an attempt to use a fancy path generator
# like the one in .zshenv
new_path=""
expected_path=(
"$HOME/bin/$MACHTYPE-$OSTYPE"
"$HOME/bin"
"$HOME/bin/git_achievements"
"$HOME/.rvm/bin"
"$HOME/.gem/ruby/1.8/bin"
"$HOME/Documents/android-sdk-mac-x86_64-20140321/tools"
"$HOME/Documents/android-sdk-mac-x86_64-20140321/platform-tools"
/opt/local/apache2/bin
/opt/python/bin
/opt/local/bin
/opt/local/sbin
/opt/local/lib/postgresql93/bin
/opt/local/lib/postgresql91/bin
/opt/local/lib/postgresql90/bin
/opt/local/lib/postgresql83/bin
/opt/local/lib/mysql56/bin
/opt/local/lib/mysql55/bin
/opt/local/lib/mysql5/bin
/opt/local/lib/mysql4/bin
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin
/opt/local/Library/Frameworks/Python.framework/Versions/2.4/bin
/sw/bin
/sw/sbin
/usr/bin/perlbin/site
/usr/bin/perlbin/vendor
/usr/bin/perlbin/core
/usr/local/Cellar/python/2.7/bin
/usr/local/bin
/usr/local/sbin
/usr/local/etc
/usr/Programs/bin
/sbin
/bin
/usr/bin
/usr/sbin
/usr/ucb
/usr/bsd
/usr/libexec
/Developer/Tools
/opt/ruby1.8/bin
/usr/X11R6/bin
/usr/X11/bin
/usr/bin/X11
/usr/local/X11/bin
/usr/local/contrib/lib/kde/bin
/usr/local/tex/bin
/usr/local/lib/zsh/scr
/usr/local/games
/usr/games
/etc
)
for element in "${expected_path[@]}"
do
if [ -d $element ]; then
if [ -z $new_path ]; then
new_path=$element
else
new_path=$new_path:$element
fi
fi
done
PATH=$new_path
export PATH
# Enable a few things for less (This will also apply to man)
# * turn off case sensitive search (-I)
# * display a long prompt with more info (-M)
# * show colors instead of escape characters (-R)
# * don't clear the screen on exit (-X)
export LESS="-IMRX"
# Force C style sorting (e.g. dotfiles, then Uppercase then lowercase)
export LC_COLLATE=C
# use a fancy terminal if we aren't using tmux
[ -z "$TMUX" ] && export TERM=xterm-256color
# conditionally set the editor variable
# TODO: get mvim -f to work with crontab some day :)
if checkPath vim; then
PREFERRED_EDITOR=vim
elif checkPath mate_wait; then
# to set this up you need to symlink the mate command
# $ cd ~/bin
# $ ln -s /path/to/mate mate_wait
PREFERRED_EDITOR=mate_wait
else
# there should be at least vi on the machine!
PREFERRED_EDITOR=vi
fi
export EDITOR=$PREFERRED_EDITOR
if checkPath vimpager; then
export PAGER=vimpager
# vim pager doesn't currently support ansi colors
export GIT_PAGER=less
alias less=$PAGER
alias zless=$PAGER
fi
# get crazy with python, and the cheese whiz
export PYTHONSTARTUP=$HOME/.pystartup
# pip settings
export PIP_FIND_LINKS="http://dist.sixfeetup.com/public/"
export PIP_DOWNLOAD_CACHE="$HOME/.pip_download_cache"
# set up some more OS X specific stuff
if [ $UNAME = "Darwin" ]; then
# Figure out the major and minor version of OS X
os_majorversion=$(sw_vers | awk '/ProductVersion/ {print $2}' | cut -f2 -d'.')
os_minorversion=$(sw_vers | awk '/ProductVersion/ {print $2}' | cut -f3 -d'.')
# to not tar up resource forks, you'll need this
if [ $os_majorversion -ge 5 ]; then
# Leopard version (and beyond??)
export COPYFILE_DISABLE="True"
elif [ ${os_majorversion} -eq 4 ] && [ ${os_minorversion} -ge 6 ]; then
# Tiger version
export COPY_EXTENDED_ATTRIBUTES_DISABLE="True"
fi
fi
# colors!!!
###########
# for FreeBSD
# Pretty LSCOLORS explanation:
# http://www.mjxg.com/index.py/geek/lscolors_and_ls_colors
export LSCOLORS="exFxbxbhcxfxgxdxdhebeb"
# set the ACK match color scheme
export ACK_COLOR_MATCH="red"
export GREP_COLORS="ms=01;31:mc=01;31:sl=:cx=:fn=32:ln=36:bn=32:se=39"