-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.bashrc
121 lines (88 loc) · 3.02 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# ~/.bashrc
#
# https://github.com/agkozak/dotfiles
#
# shellcheck shell=bash disable=SC2039
# Begin .bashrc benchmark {{{1
if (( AGKDOT_BENCHMARKS )) && [[ $OSTYPE != freebsd* ]]; then
(( AGKDOT_BASHRC_START=$(date +%s%N)/1000000 ))
fi
# }}}1
# If not running interactively, don't do anything
[[ $- == *i* ]] || return
# Source ~/.shrc {{{1
# shellcheck source=/dev/null
[[ -f ${HOME}/.shrc ]] && . "${HOME}/.shrc"
# }}}1
# Shell options (shopt) {{{1
shopt -s autocd # cd to directory names without typing cd
# After each command, redraw lines and columns if window size has changed
shopt -s checkwinsize
# Omit .exe on completion
case $OSTYPE in
msys|cygwin) shopt -s completion_strip_exe ;;
esac
shopt -s extglob # Extended globbing
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
shopt -s globstar
shopt -s histappend # Append to the history file (don't overwrite it)
# }}}1
# Shell variables {{{1
# don't put duplicate lines or lines starting with space in the history.
HISTCONTROL=ignoreboth
HISTFILESIZE=10000 # Number of lines to save to history file
HISTSIZE=12000 # Number of history items to keep in memory
# }}}1
# colored GCC warnings and errors
# export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# Bash Completion {{{1
# 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
#shellcheck source=/dev/null
. /usr/share/bash-completion/bash_completion
elif [[ -f /etc/bash_completion ]]; then
#shellcheck source=/dev/null
. /etc/bash_completion
fi
fi
# }}}1
# In FreeBSD, /home is /usr/home
# shellcheck disable=SC2034
[[ $OSTYPE == freebsd* ]] && _Z_NO_RESOLVE_SYMLINKS=1
# shellcheck source=/dev/null
if [[ -f ${HOME}/dotfiles/plugins/bash-z/bash-z.sh ]]; then
. "${HOME}/dotfiles/plugins/bash-z/bash-z.sh"
else
if [[ ! -d ${HOME}/dotfiles/plugins/z ]]; then
if type git &> /dev/null; then
git clone https://github.com/rupa/z.git "$HOME/dotfiles/plugins/z"
else
>&2 echo 'Please install Git.'
fi
fi
if [[ $OSTYPE != solaris* && -f ${HOME}/dotfiles/plugins/z/z.sh ]]; then
. "${HOME}/dotfiles/plugins/z/z.sh"
fi
fi
# if type kubectl &> /dev/null; then
# . "${HOME}/dotfiles/prompts/kube-ps1/kube-ps1.sh"
# . "${HOME}/dotfiles/prompts/polyglot-kube-ps1/polyglot-kube-ps1.sh"
# fi
# End .bashrc benchmark {{{
if (( AGKDOT_BENCHMARKS )) && [[ $OSTYPE != freebsd* ]]; then
(( AGKDOT_BASHRC_FINISH=$(date +%s%N)/1000000 ))
>&2 echo ".bashrc loaded in $((AGKDOT_BASHRC_FINISH-AGKDOT_BASHRC_START))ms total."
fi
unset AGKDOT_BASHRC_START AGKDOT_BASHRC_FINISH
# }}}
# source ~/.bashrc.local {{{1
if [[ -f "$HOME/.bashrc.local" ]]; then
# shellcheck source=/dev/null
. "$HOME/.bashrc.local"
fi
# }}}1
# vim: ai:fdm=marker:ts=2:sw=2:et:sts=2