-
Notifications
You must be signed in to change notification settings - Fork 1
/
.bashrc
105 lines (77 loc) · 1.91 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# .bashrc
# User specific aliases and functions
# source /etc/profile
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
#####
# Z is the new J
# . ~/tools/z.sh
#################
# Aliases
# -> Prevents accidentally clobbering files.
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# easier to jump around
alias ..='cd ..'
# vim alias
alias vi=vim
# force colors on ls
if [[ $OSTYPE == 'linux-gnu' ]]; then
alias ls='ls --color=always -B'
elif [[ $OSTYPE == 'darwin10.0' ]]; then
alias ls='ls -G'
fi
alias ll='ls -l'
# force colors on grep
alias grep='grep --color=AUTO'
alias fgrep='fgrep --color=AUTO'
# set default editor
export EDITOR=/usr/bin/vim
# Set the window title for screen
case $TERM in
screen*)
# This is the escape sequence ESC k \w ESC \
#Use path as title
SCREENTITLE='\[\ek\w\e\\\]'
#Use program name as title
# SCREENTITLE='\[\ek\e\\\]'
;;
*)
SCREENTITLE=''
;;
esac
# Turn off XON/XOFF process control to make <CTRL-s> not hang VIM and Command-T
# See: https://wincent.com/forums/command-t/topics/430
stty -ixon
PS1="${SCREENTITLE}${PS1}"
# Path
PATH=.:$PATH:/usr/local/bin
PATH=$PATH:~/vsatools/bin
export PATH
# SSH PASSPHRASE
# Using ssh-agent to remember pass phrases
# Because pass phrases are for suckers
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initializing new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}
# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
#ps ${SSH_AGENT_PID} doesn't work under cywgin
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
export PATH=$HOME/local/bin:$PATH