public
Description:
Homepage:
Clone URL: git://github.com/dannyamey/dotfiles.git
dotfiles / bashrc
100644 69 lines (56 sloc) 1.545 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
# For interactive shells only
[ -z "$PS1" ] && return
 
### Functions
 
# Pushes public SSH key to remote host
ssh-keypush() {
    cat .ssh/id_rsa.pub | ssh $1 "cat >> .ssh/authorized_keys2"
}
 
### Environment
 
# Fix bash history
export HISTCONTROL=erasedups
export HISTSIZE=10000
shopt -s histappend
 
# Make bash check its window size after a process completes
shopt -s checkwinsize
 
# Prompt
PS1='\h:\W \u\$ '
 
# Default editor
if [ `which bbedit` ]; then
    export EDITOR=bbedit
elif [ `which vim` ]; then
    export EDITOR=vim
else
    export EDITOR=vi
fi
 
# OS X Homebrew (http://github.com/mxcl/homebrew/)
if [ `which brew` ]; then
    export PATH=`brew --prefix`/bin:$PATH
    export MANPATH=`brew --prefix`/share/man:$MANPATH
fi
 
# User $HOME bin
if [ -d $HOME/bin ]; then
    export PATH=$HOME/bin:$PATH
fi
 
# Java home
if [ -d /Library/Java/Home ]; then
    export JAVA_HOME=/Library/Java/Home
fi
 
# virtualenvwrapper (http://www.doughellmann.com/projects/virtualenvwrapper/)
if [ `which virtualenvwrapper_bashrc` ]; then
    source virtualenvwrapper_bashrc
fi
 
# Git (http://www.kernel.org/pub/software/scm/git/docs/git-config.html)
if [ `which git` ]; then
    git config --global core.excludesfile ~/.gitignore
    git config --global core.whitespace -trailing-space
    git config --global color.status auto
    git config --global color.diff auto
    git config --global color.branch auto
fi
 
# Run any local
if [ -d $HOME/.bashrc.d ]; then
    for rc_file in $( echo $HOME/.bashrc.d/* )
    do
        source $rc_file
    done
fi