forked from MikeMcQuaid/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 6
/
bash_profile.sh
44 lines (34 loc) · 1.11 KB
/
bash_profile.sh
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
# load shared shell configuration
source ~/.shprofile
# Set HOST for ZSH compatibility
export HOST=$HOSTNAME
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# Enable history appending instead of overwriting.
shopt -s histappend
# Save multiline commands
shopt -s cmdhist
# Correct minor directory changing spelling mistakes
shopt -s cdspell
# Bash completion
[ -f /etc/profile.d/bash-completion ] && source /etc/profile.d/bash-completion
[ -f "$BREW_PREFIX/etc/bash_completion" ] && source "$BREW_PREFIX/etc/bash_completion" >/dev/null
# Colorful prompt
if [ "$USER" = "root" ]
then
PS1='\[\033[01;35m\]\h\[\033[01;34m\] \W #\[\033[00m\] '
elif [ -n "${SSH_CONNECTION}" ]
then
PS1='\[\033[01;36m\]\h\[\033[01;34m\] \W #\[\033[00m\] '
else
PS1='\[\033[01;32m\]\h\[\033[01;34m\] \W #\[\033[00m\] '
fi
# fix delete key on OSX
[ "$OSX" ] && bind '"\e[3~" delete-char'
# alternate mappings for Ctrl-U/V to search the history
bind '"^u" history-search-backward'
bind '"^v" history-search-forward'
if [ -f "$HOME/.env" ]; then
source $HOME/.env
fi