-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
66 lines (57 loc) · 1.46 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
export CLICOLOR=true
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home"
source ~/.git-prompt.sh
#source ~/.git-stats.sh
# Source the git bash completion file
if [ -f ~/.git-completion.bash ]; then
source ~/.git-completion.bash
GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWSTASHSTATE=true
GIT_PS1_SHOWUPSTREAM="auto"
PS1='\t:\[\033[32m\]$(__git_ps1 " (%s)")\[\033[00m\] \W$ '
fi
export PS1
ENVLOC=$HOME/.bashvars
function grabvars {
vars="
SSH_AGENT_PID
SSH_AUTH_SOCK
GNOME_KEYRING_SOCKET
GNOME_KEYRING_PID
SESSION_MANAGER
XAUTHORITY
DBUS_SESSION_BUS_ADDRESS
DISPLAY
";
for i in $vars;do
echo "${i}=\"${!i}\"";
done > $ENVLOC
}
if [ "$TERM" = "screen" ]; then
#PROMPT_COMMAND='echo -ne "\033k[$HOSTNAME\033\\"'
screen_set_window_title () {
local HPWD="$PWD"
case $HPWD in
$HOME) HPWD="~";;
## long name option:
# $HOME/*) HPWD="~${HPWD#$HOME}";;
## short name option:
*) HPWD=`basename "$HPWD"`;;
esac
printf '\ek%s\e\\' "$HPWD"
}
PROMPT_COMMAND="screen_set_window_title; $PROMPT_COMMAND"
fi
precmd()
{
if [[ ( ${-} == *i* ) && ( ${TERM} == screen* ) ]]
then
echo -n "\ek$(hostname -s)\e\\"
fi
}
export EDITOR=vim
export HISTCONTROL=ignoredups
shopt -s histappend
export PATH
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"