-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbashrc
66 lines (53 loc) · 1.24 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
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
alias l='ls -lt'
alias grep='grep --color=auto'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias rm='rm -I'
alias cp='cp -a'
alias cdb='cd $OLD_PWD'
export EDITOR=vim
export PS1="\[\033[01;32m\]\$(pwd)\[\033[01;34m\] $>\[\033[00m\] "
# For a colored output of iostat
export S_COLORS=always
if [ $UID -eq 0 ] ; then
export PS1="\[\033[01;31m\]# \$(pwd) $>\[\033[00m\] "
fi
#Automatically do an ls after each cd
cd() {
OLD_PWD=`pwd`
if [ -n "$1" ]; then
builtin cd "$@" && ls
else
builtin cd ~ && ls
fi
}
# lh: ls -lt | head -n 15
lh() {
if [ -n "$1" ]; then
ls -lt "$1" | head -n 15
else
ls -lt | head -n 15
fi
}
YELLOW="\[\033[0;33m\]"
NO_COLOUR="\[\033[0m\]"
# Git configuration
if [ "\$(type -t __git_ps1)" ]; then
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWSTASHSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
PS1="$PS1\$(__git_ps1 '$YELLOW(git:%s$YELLOW)> $NO_COLOUR')"
fi
source ~/.git-completion.bash
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