public
Description: My configuration files for various applications
Homepage: http://mina86.com/
Clone URL: git://github.com/mina86/dot-files.git
dot-files / bashrc
100755 81 lines (64 sloc) 1.881 kb
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
## -*- shell-script -*-
## .bashrc -- bash configuration file
## Copyright 2004-2008 by Michal Nazarewicz (mina86/AT/mina86.com)
##
 
# Include ~/.shellrc
if [ -r ~/.shellrc ]; then
. ~/.shellrc
fi
 
# Not interactive?
[ X"${-#*i}" != X"$-" ] || return
 
 
##
## Prompt
##
 
# tpwd
if declare -f tpwd >/dev/null 2>&1; then
P='$(tpwd -n 30 {)'
elif P="$(which tpwd 2>/dev/null)"; then
eval "$("$P" --bash)"
P='$(tpwd -n 30 {)'
else
P='\w'
fi
 
 
if [ X"$TERM" = Xdumb ]; then # EMACS' eshell (no colors)
PS1='[\u@\h '"$P"']\$ '
elif [ X"$TERM" = Xeterm ]; then # EMACS' term (ugly line editing)
PS1='\
\[\033[1;32;44m\]'"$P"'\
\[\033[0;1;33m\]\$\[\033[0m\] '
else # FIXME: I need to check if term sup. colors
PS1='\
\[\033[0;37;44m\][\
\[\033[1;3$(($UID?2:1));44m\]\u\
\[\033[1;37;44m\]@'
if [ -z "$SSH_CLIENT$SSH_CONNECTION" ]
then PS1="$PS1"'\[\033[1;36;44m\]\h '
else PS1="$PS1"'\[\033[1;33;44m\]\h '
fi
PS1="$PS1"'\
\[\033[1;32;44m\]'"$P"'\
\[\033[0;37;44m\]]\
\[\033[0;1;3$(($??5:3))m\]\$\[\033[0m\] '
fi
 
# Add title to terminals
case "$TERM" in xterm*|rxvt*)
if [ -z "$SSH_CLIENT$SSH_CONNECTION" ]
then PS1="$PS1"'\[\033]2;\w\007\]'
else PS1="$PS1"'\[\033]2;\h: \w\007\]'
fi
esac
 
unset PROMPT_COMMAND P
 
 
 
 
##
## Shell optons and parameters
##
shopt -qu cdable_vars checkhash dotglob execfail extglob interactive_comments
shopt -qu interactive_comments lithist no_empty_cmd_completion nocaseglob
shopt -qu shift_verbose sourcepath xpg_echo
 
shopt -qs cdspell checkwinsize cmdhist expand_aliases histappend histreedit
shopt -qs histverify hostcomplete nullglob promptvars huponexit
 
if [ "$_hostname" != Xdedal ]; then
shopt -qu extdebug force_fignore
shopt -qs failglob extquote gnu_errfmt
fi
 
HISTCONTROL="ignorespace:erasedups"
HISTIGNORE="ls:su:cd:bc:wp rm:mp3 mv:cd -"