-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc
More file actions
executable file
·87 lines (66 loc) · 2.54 KB
/
.bashrc
File metadata and controls
executable file
·87 lines (66 loc) · 2.54 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
82
83
84
85
86
87
# Don't do anything if not running interactively
if [[ $- != *i* ]]; then
return
fi
if [ "$(uname -s)" = "Darwin" ]; then
OS="OSX"
else
OS=$(uname -s)
fi
# Source global definitions first so that local ones can override them
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# disable START/STOP signal to the terminal. Especially useful when using screen, tmux, byobu
stty -ixon
HISTSIZE=99999 # bash history will save N commands
HISTFILESIZE=${HISTSIZE} # bash will remember N commands
HISTCONTROL=ignoreboth # History options ignore duplicate commands and whitespace in
# Keep the times of the commands in history
HISTTIMEFORMAT='%F %T '
HISTIGNORE="ls:exit:history:[bf]g:jobs:reset:clear"
shopt -s cdspell # Autocorrect fudged paths in cd calls
shopt -s checkhash # Update the hash table properly
shopt -s checkwinsize # Update columns and rows if window size changes
shopt -s cmdhist # Put multi-line commands onto one line of history
shopt -s dotglob # Include dotfiles in pattern matching
shopt -s extglob # Enable advanced pattern matching
shopt -s histappend # Append rather than overwrite Bash history
# shopt -u hostcomplete # Don't use Bash's builtin host completion
# shopt -u mailwarn # Don't warn me about new mail all the time
# shopt -s no_empty_cmd_completion # Ignore me if I try to complete an empty line
shopt -s progcomp # Use programmable completion, if available
# shopt -s shift_verbose # Warn me if I try to shift when there's nothing there
# shopt -u sourcepath # Don't use PATH to find files to source
complete -d cd # lists only directories with cd <TAB>
# These options only exist since Bash 4.0-alpha
if ((${BASH_VERSINFO[0]} >= 4)); then
shopt -s checkjobs # Warn me about stopped jobs when exiting
shopt -s dirspell # Autocorrect fudged paths during completion
shopt -s globstar # Enable double-starring paths
fi
set -o physical
set -o notify
[ -r "$HOME/.git-prompt.sh" ] && . "$HOME/.git-prompt.sh"
# Source a script if it is executable
function source_script() {
[[ "${@:-1}" == "force" ]] && FORCE=1
for script in $*; do
if [[ -x $script || "$FORCE" == 1 ]]; then
. $script
fi
done
}
# Execute scripts under .bashrc.d
if [[ -d $HOME/.lib ]]; then
source_script "$HOME"/.lib/*.bash
fi
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
if [[ "$OS" == "OSX" ]]; then
source_script "$HOME"/.osx/*.bash
fi
# export DISABLE_AUTO_TITLE=true
unset -v config
export PATH
unset USERNAME