/
.bashrc
79 lines (69 loc) · 1.77 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
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
export PATH
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
alias kinit='kinit mmaler'
##alias
alias diff='diff -s -u'
alias df='df -h'
alias cal='cal -m -3'
alias grep='grep --color=auto'
alias egrep='egrep --color'
alias ls='ls --color'
# alias git='hub'
alias apreview='xdg-open build/tmp/en-US/html-single/index.html'
alias abuild='ccutil compile --lang en_US --type asciidoc'
##################
mkdircd ()
{
mkdir -p -- "$1" &&
cd -P -- "$1"
}
###
##Unzip all by RomanBlanco
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.tar.xz) tar xvf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tar) tar xf $1 ;;
*.tgz) tar xzf $1 ;;
*.bz2) bunzip2 -k $1 ;;
*.zip) unzip $1 ;;
*.rar) unrar e $1 ;;
*.gz) gunzip -c $1 > `echo $1 | cut -d'.' --complement -f2-` ;;
*.7z) 7za e $1 ;;
*.Z) uncompress $1 ;;
*) echo "'$1' cannot be extracted by extract()" ; return 1 ;;
esac
return 0
else
echo "'$1' is not a valid file"
return 1
fi
}
#############
#Declaration of PS1
##DOnt know what is this [ -z "$PS1" ] && return
[ -f $HOME/.git-completion.bash ] && source $HOME/.git-completion.bash
[ -f $HOME/.git-prompt.sh ] && source $HOME/.git-prompt.sh
###
__prompt_command () {
local EXIT="$?"
if [ $EXIT != 0 ] ; then
PS1="\[\e[0;31m\]•\[\e[0m\] "
else
PS1="\[\e[0;32m\]•\[\e[0m\] "
fi
PS1+='\w/$(__git_ps1 " \[\e[0;32m\]%s\[\e[0m\]") '
}
##############