-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_bashrc
94 lines (75 loc) · 2.42 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
# bash configration file
# Author: Heng LIN ([email protected])
[ -z "$PS1" ] && return
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
HISTCONTROL=ignoredups:ignorespace
shopt -s histappend
HISTSIZE=10000
HISTFILESIZE=20000
show-git-branch()
{
RET=$?
git branch 2> /dev/null | sed '/^[^*]/d; s/^\*//'
return $RET
}
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;33m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[\033[01;35m\]$(show-git-branch) \[\033[1;$((31+3*!$?))m\]\$\[\033[00m\] '
#PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[\033[01;35m\]$(show-git-branch) \[\033[1;$((31+3*!$?))m\]\$\[\033[00m\] '
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# for bash completion
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
# some more ls aliases
alias ll='ls -alFh'
alias la='ls -A'
alias l='ls -CF'
#alias ls='ls -G' # for macOS
alias rm='rm -i'
alias zz='za'
abs_path() {
if [ $# -eq 0 ]; then
perr 'usage: abs_path pname ...'
return $(false)
fi
while [ $# -gt 0 ]; do
pname=$1
if [ -d "$pname" ]; then
echo `cd "$pname" && pwd`
else
echo `cd $(dirname "$pname") && echo $PWD/$(basename "$pname")`
fi
shift
done
unset pname
return $(true)
}
alias ff='dirs -p -v'
alias mm='make clean && make'
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
# For Kaveri
#export C_INCLUDE_PATH=$C_INCLUDE_PATH:/opt/AMDAPPSDK-3.0/include
#export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/opt/AMDAPPSDK-3.0/include
#export DISPLAY=:0
#xhost + > /dev/null
# For Intel compiler
#source /opt/intel/vtune_amplifier_xe_2013/amplxe-vars.sh > /dev/null
#source /opt/intel/composerxe/bin/compilervars.sh intel64 > /dev/null
#source /opt/intel/impi_latest/bin64/mpivars.sh
#export JAVA_HOME=/opt/jdk1.6.0_30/jre
#export PATH=/opt/jdk1.6.0_30/bin:$PATH