-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_profile
53 lines (43 loc) · 949 Bytes
/
.bash_profile
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
source $HOME/.profile
# Command completion
if [ -f /etc/bash_completion ]; then
./etc/bash_completion
fi
complete -cf sudo
complete -cf man
# Aliases
alias l='ls --color=auto -l'
alias la='ls --color=auto -la'
alias vi=vim
# Prompt
white="1;37m"
if [ $EUID -ne 0 ]; then
color="1;34m"
else
color="1;31m"
fi
if [ -n "$SSH_CLIENT" ]; then
host="\[\e[$white\]@\[\e[$color\]\H"
else
host=""
fi
if [ "$TERM" == "screen" ]; then
host="${host} \[\e[$white\](screen)"
fi
export PS1="\[\e[$color\]\u${host} \[\e[$white\]\w\[\e[$color\] $ \[\e[m\]"
# Colorized manpages
man() {
env LESS_TERMCAP_mb=$'\E[01;31m' \
LESS_TERMCAP_md=$'\E[01;38;5;74m' \
LESS_TERMCAP_me=$'\E[0m' \
LESS_TERMCAP_se=$'\E[0m' \
LESS_TERMCAP_so=$'\E[38;5;246m' \
LESS_TERMCAP_ue=$'\E[0m' \
LESS_TERMCAP_us=$'\E[04;38;5;146m' \
man "$@"
}
# Make dir and change to it
mkcd() {
mkdir "$*"
cd "$*"
}