-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbashrc
More file actions
35 lines (29 loc) · 1007 Bytes
/
Copy pathbashrc
File metadata and controls
35 lines (29 loc) · 1007 Bytes
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
#!/usr/bin/env bash
# Interactive shell only.
[[ $- != *i* ]] && return
# Fallback when XDG vars are not initialized by profile.
: "${XDG_CONFIG_HOME:=$HOME/.config}"
# Load the shell dotfiles.
for file in ${XDG_CONFIG_HOME}/bash/{path,functions,aliases,exports}; do
[ -r "$file" ] && [ -f "$file" ] && source "$file"
done
unset file
# Machine-local overrides. Keep this file outside the dotfiles repo.
if [ -r "${XDG_CONFIG_HOME}/bash/local" ] && [ -f "${XDG_CONFIG_HOME}/bash/local" ]; then
source "${XDG_CONFIG_HOME}/bash/local"
fi
# Bash behavior.
shopt -s nocaseglob
shopt -s histappend
shopt -s cdspell
# Homebrew shell completion.
if type brew &>/dev/null; then
HOMEBREW_PREFIX="$(brew --prefix)"
if [[ -r "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh" ]]; then
source "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh"
else
for COMPLETION in "${HOMEBREW_PREFIX}/etc/bash_completion.d/"*; do
[[ -r "${COMPLETION}" ]] && source "${COMPLETION}"
done
fi
fi