blob: abfc6267260e7f11173b448350e85f4eeaed82ca (
plain) (
blame)
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
|
# Give up completely if no BASH_VERSINFO (<2.0)
if [ -z "$BASH_VERSINFO" ]; then
printf \
'%s: %s is too old to work with this configuration.\n' \
"${BASH##*/}" "$BASH_VERSION" >&2
return
fi
# Don't do anything if not running interactively
if [[ $- != *i* ]]; then
return
fi
# Keep plenty of history; unlimited, if we have >=4.3
if ((${BASH_VERSINFO[0]} >= 4 \
&& 10#${BASH_VERSINFO[1]%%[![:digit:]]*} >= 3)); then
HISTFILESIZE=-1
HISTSIZE=-1
else
HISTFILESIZE=1000000
HISTSIZE=1000000
fi
# Ignore duplicate commands and whitespace in history
HISTCONTROL=ignoreboth
# Keep the times of the commands in history
HISTTIMEFORMAT='%F %T '
# Only tell me about new mail if MAIL is set and in $HOME
if [[ $MAIL == "$HOME"/* ]]; then
MAILCHECK=15
else
unset -v MAILCHECK
fi
# Never beep at me
setterm -bfreq 0 2>/dev/null
# Turn off flow control and control character echo
stty -ixon -ctlecho 2>/dev/null
# Autocorrect fudged paths in cd calls
shopt -s cdspell
# Update the hash table properly
shopt -s checkhash
# Update columns and rows if window size changes
shopt -s checkwinsize
# Put multi-line commands onto one line of history
shopt -s cmdhist
# Include dotfiles in pattern matching
shopt -s dotglob
# Enable advanced pattern matching
shopt -s extglob
# Append rather than overwrite Bash history
shopt -s histappend
# Don't use Bash's builtin host completion
shopt -u hostcomplete
# Don't warn me about new mail all the time
shopt -u mailwarn
# Ignore me if I try to complete an empty line
shopt -s no_empty_cmd_completion
# Use programmable completion, if available
shopt -s progcomp
# Warn me if I try to shift when there's nothing there
shopt -s shift_verbose
# Don't use PATH to find files to source
shopt -u sourcepath
# These options only exist since Bash 4.0-alpha
if ((${BASH_VERSINFO[0]} >= 4)); then
# Warn me about stopped jobs when exiting
shopt -s checkjobs
# Autocorrect fudged paths during completion
shopt -s dirspell
# Enable double-starring paths
shopt -s globstar
fi
# Load any supplementary scripts
if [[ -d $HOME/.bashrc.d ]]; then
for config in "$HOME"/.bashrc.d/*; do
[[ -f $config ]] && source "$config"
done
fi
unset -v config
|