-
Notifications
You must be signed in to change notification settings - Fork 8
/
_bashrc
55 lines (43 loc) · 1.19 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
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
PS1='\h:\w\$ '
OS='uname -s'
# My aliases
source ~/.aliases
# Useful functions
source ~/.bashrc.functions
export EDITOR=vim
export TERM=xterm-256color
export GTEST=/usr/local/gtest
alias gtest="g++ -g -I${GTEST}/include -L${GTEST} -lgtest -lpthread"
# Make sure display get updated when terminal window get resized
shopt -q -s checkwinsize
# Turn on the extended pattern matching features
shopt -q -s extglob
# Append rather than overwrite history on exit
shopt -s histappend
# Disable [CTRL-D] which is used to exit the shell
set -o ignoreeof
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising 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
[ -f ~/.fzf.bash ] && source ~/.fzf.bash