-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash_profile
98 lines (77 loc) · 2.65 KB
/
bash_profile
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
# .bash_profile for sysconfig
# Personal environment variables and startup programs.
# Personal aliases and functions should go in ~/.bashrc. System wide
# environment variables and startup programs are in /etc/profile.
# System wide aliases and functions are in /etc/bashrc.
# Personal startup programs
pathprepend() {
for ARG in "$@"
do
if [ -d "$ARG" ] && [[ ":$PATH:" != *":$ARG:"* ]]; then
PATH="$ARG${PATH:+":$PATH"}"
fi
done
}
sourcefile() {
for ARG in "$@"
do
if [ -f "$ARG" ] ; then
source $ARG
fi
done
}
pathprepend $HOME/.bin
pathprepend $HOME/.yarn/bin
pathprepend $HOME/.config/yarn/global/node_modules/.bin
pathprepend $HOME/Library/Android/sdk/platform-tools
sourcefile $HOME/.inputrc
sourcefile $HOME/.bashrc
sourcefile $HOME/.localrc
## SSH tab completion for hostnames based on config
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2- | tr ' ' '\n')" scp sftp ssh;
## Autojump
[[ -s "/opt/pkg/share/autojump/autojump.sh" ]] && . /opt/pkg/share/autojump/autojump.sh
[[ -s "/opt/pkg/share/autojump/autojump.bash" ]] && . /opt/pkg/share/autojump/autojump.bash
## Git Flow Completion
# source $HOME/.sysconfig/bash_completion.d/git-completion.bash
# source $HOME/.sysconfig/bash_completion.d/git-flow-completion.bash
export GH_LOGIN=stephenway
# Personal environment variables
## Bash
GIT_PS1_SHOWDIRTYSTATE=true
export COMMAND_MODE=unix2003;
export BROWSER=open;
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
## Bash Git Prompt
if [ -f "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" ]; then
__GIT_PROMPT_DIR=$(brew --prefix)/opt/bash-git-prompt/share
GIT_PROMPT_ONLY_IN_REPO=0
GIT_PROMPT_THEME=Default_Ubuntu
source "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh"
fi
## Vim
export EDITOR=vim;
export VIM_BINARY="/usr/local/bin/vim";
export MVIM_BINARY="/usr/local/bin/mvim";
export VIMRC="$HOME/.vimrc";
## GPG Keys
export GPG_TTY=$(tty)
eval $(/usr/libexec/path_helper -s)
export PS1="\h \$ "
## NVM
export NODE_ENV="development";
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
if [[ -f .nvmrc && -r .nvmrc ]]; then
nvm use --silent
fi
export NODE_PATH=$NODE_PATH:`npm root -g`;
## iTerm Integration
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"
function iterm2_print_user_vars() {
iterm2_set_user_var phpVersion $(php -v | awk '/^PHP/ { print $2 }')
iterm2_set_user_var rubyVersion $(ruby -v | awk '{ print $2 }')
iterm2_set_user_var nodeVersion $(node -v)
}