-
Notifications
You must be signed in to change notification settings - Fork 0
/
bashrc
81 lines (67 loc) · 2.25 KB
/
bashrc
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
# assuming that bash_completions is installed via brew (brew install bash-completion)
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
## git functions and config
# ssh autocomplete support from .ssh/config and .ssh/known_hosts
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;
cat ~/.ssh/config | \
grep "^Host " | \
awk '{print $2}'
`
COMPREPLY=( $(compgen -W "${comp_ssh_hosts}" -- $cur))
return 0
}
complete -F _complete_ssh_hosts ssh
# setting this variable to true will add an asterisk to your command prompt
# if your branch has unstaged changes
GIT_PS1_SHOWDIRTYSTATE=true
# PS1. includes git context
export PS1='\[\033[32m\]\u@\h\[\033[00m\]:\[\033[36m\]\w\[\033[31m\]$(__git_ps1)\[\033[00m\]\$ '
## Path control
# use brew bins first
PATH=/usr/local/bin:$PATH
export PATH
# use coreutils
export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH"
#colors
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
# keep markup-convert unit tests from stealing window focus
export JAVA_TOOL_OPTIONS="-Djava.awt.headless=true"
# swap versions in a pom recursively
swapVersions() {
if [ $# -ne 2 ]
then
echo "Usage: swapVersions <oldVersion> <newVersion>"
else
find . -name pom.xml -exec sed -i .orig "s/$1/$2/g" {} \;
fi
}
# switch java versions
case "$OSTYPE" in
darwin*)
alias j6='JAVA_HOME=`/usr/libexec/java_home -v "1.6"`'; export JAVA_HOME
alias j7='JAVA_HOME=`/usr/libexec/java_home -v "1.7"`'; export JAVA_HOME
;;
*)
echo "***Did not understand OSTYPE varible***"
;;
esac
# aliases
alias mp='mvn clean package'
alias mi='mvn clean install'
alias mc='mvn clean compile'
alias mt='mvn clean test'
alias muv='mvn clean -N versions:update-child-modules -DgenerateBackupPoms=false'
alias mvv='mvn clean verify'