/
.bashrc
68 lines (53 loc) · 1.1 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
# root should use /bin/bash
if [ $UID != 0 -a -x "$(which zsh)" ]; then
exec zsh
fi
### shopt ###
shopt -s nocaseglob
shopt -s cdspell
set bell-style visible
### alias ###
alias df='df -h'
alias du='du -h'
alias less='less -r'
alias l='ls'
alias ll='ls -lh'
alias la='ls -A'
alias l.='ls -d .*'
OS="$(uname -o)"
if [ "$OS" = "Cygwin" ]; then
alias less='less -r'
alias ls='ls --color=tty --show-control-chars'
else
alias ls='ls --color=tty'
fi
if [ -x "$(which vim)" ]; then
alias vi=vim
fi
if [ -f "$HOME/.alias.local" ]; then
source "$HOME/.alias.local"
fi
### cygwin ###
if [ "$OS" = 'Cygwin' ]; then
function wwhich() {
if [ $# != 0 ]; then
cygpath -w -a $(which $1)
fi
}
function wpwd() {
/usr/bin/cygpath -w -a .
}
function screen() {
local conf="$HOME/.screenrc.cygwin"
if [ -f "$conf" ]; then
command screen -c "$conf" "$@"
else
command screen "$@"
fi
}
fi
# delete duplicated elements
if [ -x "$(which rmdupenv)" ]; then
rmdupenv PATH
rmdupenv PERL5LIB
fi