forked from saz/dotfiles_old
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_bashrc
More file actions
231 lines (185 loc) · 6.49 KB
/
Copy path_bashrc
File metadata and controls
231 lines (185 loc) · 6.49 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
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# dont nerv me!
set bell-style none
# enable 256 colors in terminal (useful for vim colorschemes)
if [ -e /usr/share/terminfo/x/xterm-256color ] ; then
export TERM='xterm-256color'
else
export TERM='xterm-color'
fi
if [ -f "$HOME/.config/golang" ] ; then
. "$HOME/.config/golang"
fi
if [ -f "$HOME/.config/perl" ] ; then
. "$HOME/.config/perl"
fi
# GNU core utils
if [ -d /usr/local/opt/coreutils/libexec/gnubin ] ; then
PATH="/usr/local/opt/coreutils/libexec/gnubin::$PATH"
fi
# macport stuff
if [ -d /opt/local/bin ] && [ -d /opt/local/sbin ] ; then
PATH="/opt/local/bin:/opt/local/sbin:$PATH"
if [ -d /opt/local/lib/qt3 ] ; then
export QTDIR=/opt/local/lib/qt3
fi
if [ -d /opt/local/share/man ] ; then
export MANPATH="/opt/local/share/man:$MANPATH"
fi
fi
# mysql binaries
if [ -d /usr/local/mysql/bin ] ; then
PATH="/usr/local/mysql/bin:$PATH"
fi
# Haskell Plattform
if [ -d "$HOME/Library/Haskell/bin" ] ; then
PATH="$HOME/Library/Haskell/bin:$PATH"
fi
# cabal installation
if [ -d "$HOME/.cabal/bin" ] ; then
PATH="$HOME/.cabal/bin:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
PATH="/usr/local/sbin:$PATH"
export PATH
if [ -x /usr/libexec/java_home ] ; then
export JAVA_HOME=$(/usr/libexec/java_home)
fi
if [ -d /opt/local/share/java/grails ] ; then
export GRAILS_HOME=/opt/local/share/java/grails
fi
if [ -d "$HOME/Applications/UMLet" ] ; then
export UMLET_HOME="$HOME/Applications/UMLet"
fi
export MAVEN_OPTS="-Xmx512m"
if [ -d /usr/share/maven ] ; then
export M2_HOME=/usr/share/maven
fi
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
# append to the history file, don't overwrite it
shopt -s histappend
# Set HISTSIZE and HISTFILESIZE to an empty value as we append and love our history :)
# unset isn't working. It will be reset to 500 everytime!
export HISTSIZE=
export HISTFILESIZE=
# Save history immediatly after running command
# With "history -n" it's possible to read all new lines since last read
PROMPT_COMMAND="history -a"
# 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 "$(SHELL=/bin/sh lesspipe)"
export LESS="-iFRsX"
export PAGER=less
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
parse_git_branch() {
git name-rev HEAD 2> /dev/null | sed "s#HEAD\ \(.*\)#(\1)\ #"
}
if [ "$color_prompt" = yes ]; then
PS1='\u@\h \w \[\033[90m\]$(parse_git_branch)\[\033[37m\]$\[\033[00m\] '
else
PS1='\u@\h \w $(parse_git_branch) '
fi
export PS1
unset color_prompt force_color_prompt
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f "$HOME/.bash_aliases" ] ; then
. "$HOME/.bash_aliases"
fi
if [ -f "$HOME/.ssh_aliases" ] ; then
source "$HOME/.ssh_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 ] && ! shopt -oq posix ; then
. /etc/bash_completion
fi
if [ -f "$HOME/.config/git_completion" ] ; then
. "$HOME/.config/git_completion"
fi
# Set to UTF-8 and english locale
export LANG="en_US.UTF-8"
# Set to 'C' to make ls sort dotfiles
export LC_COLLATE=C
export CLICOLOR=1
# for `ls` (GNU coreutils, homebrew)
# port install coreutils +with_default_names
if [ "$TERM" != "dumb" ] ; then
export LS_OPTIONS='--color=auto --file-type'
# FIXIT: Which is the right name and determine BSD/MACOS or LINUX
export LSCOLORS=gxfxcxdxbxegedabagacad
export LS_COLORS='no=00:fi=00:di=01;35:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.flac=01;35:*.mp3=01;35:*.mpc=01;35:*.ogg=01;35:*.wav=01;35:';
eval `dircolors "$HOME/.dir_colors"`
fi
# Set the right editor
export EDITOR=/usr/bin/nano
# Set CONCURRENCY_LEVEL to number of CPUs
if [ -f /proc/cpuinfo ]; then
# linux style
CONCURRENCY_LEVEL=`grep -c processor /proc/cpuinfo`
elif [ -x "`which system_profiler`" ]; then
# mac os style
CONCURRENCY_LEVEL=`system_profiler SPHardwareDataType | grep --color=never "Total Number Of Cores" | sed 's/[^0-9]*//g'`
else
CONCURRENCY_LEVEL=1
fi
export CONCURRENCY_LEVEL
# Source additional information, which applies to the current host only
if [ -f "$HOME/.bash_local" ]; then
. "$HOME/.bash_local"
fi
# Export some debian stuff
DEBEMAIL=$DEBEMAIL_local
DEBFULLNAME=$DEBFULLNAME_local
export DEBEMAIL DEBFULLNAME
# In case, we've changed the directory, switch back to home dir
cd
#if [ "$SHLVL" -lt 2 ]; then
# echo "Hit Ctrl+C to not raise screen now!"
# sleep 1
# screen -D -r
#else
if [ "$SHLVL" -gt 4 ]; then
function ssh() {
hname=${1##*@}
echo -n -e "\033k$hname\033\\"
$(which ssh) $@
echo -n -e "\033k`hostname`\033\\"
}
function telnet() {
echo -n -e "\033k$1\033\\"
$(which telnet) $@
echo -n -e "\033k`hostname`\033\\"
}
echo -n -e "\033k`hostname`\033\\"
fi
export JAUMO_ENV=Test
export _PATH=$PATH # Workaround for screen on mac os
export GOPATH=/Users/br/go