-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
83 lines (65 loc) · 1.62 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
## My shell profile.
## https://github.com/alexanderczigler/dotfiles
# If not running interactively, don't do anything.
[[ $- != *i* ]] && return
# Prompt.
PS1='\w$ '
# Settings.
export HISTSIZE=777
export HISTFILESIZE=777
export HISTCONTROL=ignoreboth:erasedups
shopt -s histappend
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
# Homebrew.
eval "$(/opt/homebrew/bin/brew shellenv)"
# direnv.
if type direnv &>/dev/null
then
eval "$(direnv hook bash)"
fi
# NVM.
NVM_DIR="/opt/homebrew/opt/nvm"
NVM_COMPLETION_PATH="/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s $NVM_COMPLETION_PATH ] && \. $NVM_COMPLETION_PATH
if type nvm &>/dev/null
then
_nvmrc_hook() {
if [[ $PWD == $PREV_PWD ]]; then
return
fi
PREV_PWD=$PWD
[[ -f ".nvmrc" ]] && nvm use
}
if ! [[ "${PROMPT_COMMAND:-}" =~ _nvmrc_hook ]]; then
export PROMPT_COMMAND="_nvmrc_hook${PROMPT_COMMAND:+;$PROMPT_COMMAND}"
fi
fi
if type gcloud &>/dev/null
then
source "$(brew --prefix)/share/google-cloud-sdk/path.bash.inc"
source "$(brew --prefix)/share/google-cloud-sdk/completion.bash.inc"
fi
function loop {
while true; do $@; sleep 10; done
}
# rbenv
if type rbenv &>/dev/null
then
eval "$(rbenv init - bash)"
fi
# bash completions
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/bash-completions:$FPATH
# Load bash completion
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
fi
# update the shell profile
function update-dotfiles {
cd ~/.dotfiles
git pull
cd -
source ~/.bashrc
}