-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdot_bashrc
66 lines (54 loc) · 1.61 KB
/
dot_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
# BASH BEHAVIOR
source "$HOME/.bash_common"
# I like to use Vim type editing of the command line, comment out
# everything below if you prefer the default Emacs-style editing.
set -o vi
# ^p check for partial match in history
bind -m vi-insert "\C-p":dynamic-complete-history
# ^n cycle through the list of partial matches
bind -m vi-insert "\C-n":menu-complete
# ^l clear screen
bind -m vi-insert "\C-l":clear-screen
# ^b back a word
bind -m vi-insert "\C-\e[C":backward-word
# ^f forward a word
bind -m vi-insert "\C-\e[D":forward-word
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# Append history, don't overwrite it--very handy when working with
# multiple shells, as closing the last one won't blow away the history
# of the previous session.
shopt -s histappend
# Bash aliases
source_if_exists "$HOME/.bash_aliases"
# Bash prompt
case "$TERM" in
xterm*|rxvt*|gnome*|screen-256color)
source_if_exists "$HOME/.bash_prompt"
;;
*)
source_if_exists "$HOME/.bash_prompt_alt"
;;
esac
# Set up ALL THE ENVs
envs=("goenv" "jenv" "nodenv" "pyenv" "rbenv")
for env in "${envs[@]}"; do
if command -v $env &> /dev/null; then
eval "$($env init -)"
fi
done
bash_completion_script="$(brew --prefix)/etc/profile.d/bash_completion.sh"
if [[ -r "$bash_completion_script" ]]; then
source "$bash_completion_script"
# Disable tilde expansion; see
# http://superuser.com/questions/95653/bash-shell-tab-completion-dont-expand-the
_expand()
{
return 0
}
__expand_tilde_by_ref()
{
return 0
}
fi