-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
95 lines (82 loc) · 2.09 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
95
# ~/.bashrc
# test for an interactive shell
case $- in
*i*) ;;
*) return;;
esac
# shell history
HISTFILESIZE=10000
HISTSIZE=5000
HISTCONTROL=ignoredups
# shell options
shopt -s checkwinsize
shopt -s histappend
# environment config
export BLOCKSIZE=K
export LESS='-c -r -f'
export GREP_COLORS='mt=31'
export LC_CTYPE='es_MX.UTF-8'
export DICTIONARY='es_MX,en_US'
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
export PATH="${PATH}:${HOME}/bin:${HOME}/.local/bin"
# make less friendly for non-text
if [ -x /usr/bin/lesspipe ]; then
eval "$(SHELL=/bin/sh lesspipe)"
fi
# chroot?
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# fancy prompt
if [ -x /usr/bin/tput ] && tput setaf 1 >& /dev/null; then
if [[ ${EUID} == 0 ]]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
else
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
fi
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h \w \$ '
fi
# term title
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# ls colors
if [ -x /usr/bin/dircolors ]; then
if [ -r ~/.dircolors ]; then
eval "$(dircolors -b ~/.dircolors)"
else
eval "$(dircolors -b)"
fi
alias ls='ls --color=auto -F -h'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
else
alias ls='ls -F -h'
fi
# emacs
if [ -n $(command -v emacs) ]; then
export EDITOR=emacs
alias ec='emacs -nw'
fi
# aliases
if [ -f ${HOME}/.bash_aliases ]; then
source ${HOME}/.bash_aliases
fi
# local config
if [ -f ${HOME}/.bash_local ]; then
source ${HOME}/.bash_local
fi
# 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