-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
87 lines (65 loc) · 2.47 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
if [[ $- != *i* ]] ; then
# Shell is non-interactive. Be done now!
return
fi
function exists {
command -v "$1" &> /dev/null
}
# +------------------+
# | Load the goodies |
# +------------------+
for file in ~/.{paths,functions,aliases,shell_prompt}.sh; do
[ -r "$file" ] && source "$file"
done
unset file
# +---------------------+
# | History |
# +---------------------+
# Use standard ISO 8601 timestamp
# %F equivalent to %Y-%m-%d
# %T equivalent to %H:%M:%S (24-hours format)
export HISTTIMEFORMAT='%F %T '
# keep history up to date, across sessions, in realtime
# http://unix.stackexchange.com/a/48113
export HISTCONTROL="ignoredups" # no duplicate entries
export HISTSIZE=100000 # big big history (default is 500)
export HISTFILESIZE=$HISTSIZE # big big history
export HISTIGNORE="&:[ ]*:exit:ls:bg:fg:history:clear" # don't record certain commands
# shopt essentially toggles the values of settings. The flag `-s` enables (sets)
# the `histappend` option. When `histappend` is set, the history list is appended
# to the file named by the value of the `HISTFILE` env var when the shell exits.
# `type shopt` returns true if the argument `shopt` is found, and false otherwise.
shopt -s histappend # append to history, don't overwrite it
# Forces Bash to save all lines of a multi-line command in the same
# history entry.
shopt -s cmdhist
# +-------------+
# | Fancy pager |
# +-------------+
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking
export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold
export LESS_TERMCAP_me=$'\E[0m' # end mode
export LESS_TERMCAP_se=$'\E[0m' # end standout-mode
export LESS_TERMCAP_so=$'\E[38;5;246m' # begin standout-mode - info box
export LESS_TERMCAP_ue=$'\E[0m' # end underline
export LESS_TERMCAP_us=$'\E[04;38;5;146m' # begin underline
export LESS="-R -X" # don't clear the screen on exit
export EDITOR=vim
case $(uname) in
Linux)
export TERM=rxvt-unicode
;;
Darwin)
export TERM=xterm-256color
;;
esac
# +-----------------------+
# | Kubectl auto-complete |
# +-----------------------+
exists kubectl && source <(kubectl completion bash)
# +-------------------------------+
# | Any extra stuff you may need |
# +-------------------------------+
if [[ -e ~/.bashrc.local ]]; then
. ~/.bashrc.local
fi