-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
53 lines (45 loc) · 1.21 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
# ~/.bashrc: executed by bash(1) for non-login shells.
# If not running interactively, don't do anything
[[ -z "$PS1" ]] && return
echo "running .bashrc"
if tty -s; then
[[ -f ${HOME}/.alias ]] && source ${HOME}/.alias && echo "running .alias"
if [ $(uname -s) = "Linux" ]; then
PATH=$PATH:/sbin:/usr/sbin/:/usr/local/bin:${HOME}/bin
fi
case $TERM in
xterm*|rxvt*)
GIT_PS1_SHOWUPSTREAM="auto"
GIT_PS1_SHOWDIRTYSTATE=1
if [ -r ~/.git-prompt.sh ] && git --version > /dev/null 2>&1; then
. ${HOME}/.git-prompt.sh
PS1='\[\033\e[0;36m\]\u\[\033\e[1;30m\]@\[\033\e[1;34m\]\h:\[\033\e[0;32m\]\w$(__git_ps1)\[\033\e[m\]\n\\$ '
else
PS1='\u@\h:\W\$ '
fi
;;
screen)
PS1='\u@\h:\w\n[screen]\$ '
;;
*)
PS1='bash\\$ '
;;
esac
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# History date/time
HISTTIMEFORMAT="%F %T | "
export HISTTIMEFORMAT
# autocomplete
complete -cf sudo
complete -cf man
complete -cf so
# set title in xterm window
function shdr {
if [ "$TERM" = "xterm" -o "$TERM" = "rxvt" ] ; then
printf '\033]2;'$*'\07'
fi
}
shdr `hostname`
fi