-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
56 lines (43 loc) · 1.64 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
#get current directory
CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ]; then
eval "`dircolors -b`"
alias ls='ls --color=auto'
fi
alias ..='cd ..'
alias sv="env | grep"
alias h="history | grep"
alias grep="grep --color=always"
#some standard settings
export EDITOR=/usr/bin/vim
# change color of hostname according to name
hostcolor="38;5;$(($(cksum<<<$(hostname)|cut -f1 -d' ')%210+22))"
export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\[\033['$hostcolor'm\]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
#xtrace output would be more useful if it contained source file and line number (by AnMaster)
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
#export PS4='+\[\033[01;32m\]${BASH_SOURCE}\[\033[0m\]:\[\033[01;34m\]${LINENO}\[\033[0m\]:${FUNCNAME[0]:+${FUNCNAME[0]}():}'
#for python
export PYTHONSTARTUP=$CUR_DIR/.pythonrc
#you may also us -u /sw/centos58-x64/devtools/git-1.7.4.1/bin/git-upload-pack
#but this will break if the path changes...
#eclipse git does not allow you to pass the command though.... :-/
#now load some aliases
source $CUR_DIR/.git_bashrc
#add current bin to path if exists
if [ -d "$CUR_DIR/bin" ] ; then
PATH="$CUR_DIR/bin:$PATH"
export PATH
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
export PATH
fi
#single history for all sessions
shopt -s histappend
HISTSIZE=10000
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth