forked from din982/dotfiles-11
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc
72 lines (60 loc) · 1.97 KB
/
zshrc
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
if [ -f "$HOME/.zprezto/init.zsh" ]; then
source "$HOME/.zprezto/init.zsh"
fi
fpath=(/usr/local/share/zsh-completions $fpath)
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# SSH_ENV=$HOME/.ssh/environment
# # start the ssh-agent
# function start_agent {
# echo "Initializing new SSH agent..."
# # spawn ssh-agent
# /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
# echo succeeded
# chmod 600 "${SSH_ENV}"
# . "${SSH_ENV}" > /dev/null
# /usr/bin/ssh-add
# }
# if [ -f "${SSH_ENV}" ]; then
# . "${SSH_ENV}" > /dev/null
# ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
# start_agent;
# }
# else
# start_agent;
# fi
# gh
GH_BASE_DIR=${GH_BASE_DIR:-$HOME/src}
GH_PROTO=${GH_PROTO:-"ssh"}
function gh {
typeset +x account=$GITHUB[user]
typeset +x repo=""
if (( ${+argv[2]} )); then
repo=$argv[2]
account=$argv[1]
elif (( ${+argv[1]} )); then
repo=$argv[1]
else
echo "USAGE: gh [user] [repo]"
return 127
fi
typeset +x directory=$GH_BASE_DIR/github.com/$account/$repo
if [[ ! -a $directory ]]; then
if [[ $GH_PROTO == "ssh" ]]; then
git clone [email protected]:$account/$repo.git $directory
elif [[ $GH_PROTO == "https" ]]; then
git clone https://github.com/$account/$repo.git $directory
else
echo "GH_PROTO must be set to ssh or https"
fi
if [[ ! -a $directory ]]; then
return 127
fi
fi
cd $directory
}
export PATH=~/bin:~/.config/yarn/global/node_modules/.bin:$PATH
# tabtab source for yarn package
# uninstall by removing these lines or running `tabtab uninstall yarn`
[[ -f /usr/local/lib/node_modules/yarn-completions/node_modules/tabtab/.completions/yarn.zsh ]] && . /usr/local/lib/node_modules/yarn-completions/node_modules/tabtab/.completions/yarn.zsh
# heroku autocomplete setup
HEROKU_AC_ZSH_SETUP_PATH=/Users/jdickey/Library/Caches/heroku/autocomplete/zsh_setup && test -f $HEROKU_AC_ZSH_SETUP_PATH && source $HEROKU_AC_ZSH_SETUP_PATH;