-
Notifications
You must be signed in to change notification settings - Fork 12
/
.bash_options
107 lines (79 loc) · 3.19 KB
/
.bash_options
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
96
97
98
99
100
101
102
103
104
105
106
107
# ~/.bash_options
# Define Bash options.
# Invoked by .bash_profile file.
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=100000
# Keep around 64K lines of history in file.
HISTFILESIZE==$((1 << 16))
# Keep the times of the commands in history
HISTTIMEFORMAT='%F %T'
# Use a more compact format for the 'time' builtin's output.
TIMEFORMAT='real:%lR user:%lU sys:%lS'
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# Correct small errors in directory names given to the `cd` buildtin.
shopt -s cdspell
# Check that hashed commands still exist before running them.
shopt -s checkhash
# Update LINES and COLUMNS after each command if necessary.
shopt -s checkwinsize
# Put multi-line commands into one history entry.
shopt -s cmdhist
# Include filenames with leading dots in pattern matching.
#shopt -s dotglob
# Expand aliases in shell scripts.
shopt -s expand_aliases
# Enable extended globbing: !(foo), ?(bar|baz)...
# If set, the extended pattern matching features are enabled.
# @see: http://wiki.bash-hackers.org/syntax/pattern
shopt -s extglob
# Append to the history file ($HISTFILE), don't overwrite it.
shopt -s histappend
# If history expansion fails, reload the command to try again.
shopt -s histreedit
# Load history expansion result as the next command, don't run them directly.
shopt -s histverify
# Don't assume a word with a @ in it is a hostname.
shopt -u hostcomplete
# Don't change newlines to semicolons in history.
shopt -s lithist
# Don't try to tell me when my mail is read.
shopt -u mailwarn
# Don't complete a Tab press on an empty line with every possible command.
shopt -s no_empty_cmd_completion
# Use programmable completion, if available.
shopt -s progcomp
# Warn me if I try to shift nonexistent values off an array.
shopt -s shift_verbose
# Don't search $PATH to find files for the `source` builtin.
shopt -u sourcepath
# Enable programmable completion features (you don't need to enable this,
# if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
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
# These options only exist since Bash 4.0-alpha
if ((BASH_VERSINFO[0] >= 4)) ; then
# Correct small errors in directory names during completion
shopt -s dirspell
# Allow double-star globs to match files and recursive paths.
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
shopt -s globstar
# Warn me about stopped jobs when exiting
# Available since 4.0, but only set it if >=4.1 due to bug:
# <https://lists.gnu.org/archive/html/bug-bash/2009-02/msg00176.html>
((BASH_VERSINFO[1] >= 1)) && shopt -s checkjobs
# Expand variables in directory completion
# Only available since 4.3
((BASH_VERSINFO[1] >= 3)) && shopt -s direxpand
fi