-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
124 lines (85 loc) · 2.61 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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="${HOME}/.oh-my-zsh"
# Uncomment the following line to use case-sensitive completion.
CASE_SENSITIVE="true"
plugins=(
command-not-found
macos
git
colored-man-pages
rust
yarn-autocompletions
zsh-autosuggestions
zsh-syntax-highlighting
)
source $ZSH/oh-my-zsh.sh
eval "$(starship init zsh)"
# User configuration
export PATH=$HOME/.bin:$PATH
export EDITOR='nvim'
alias szsh="source ${HOME}/.zshrc"
alias tm="tmux attach || tmux"
alias lg="lazygit"
# Custom bin path
export PATH="$HOME/.bin:$PATH"
export PATH="$HOME/.local/bin:$PATH"
# Neovim
alias vim=nvim
# git setup
## Github
## Github GPG Signing
export GPG_TTY=$(tty)
## Clean up git branches
git_clean_remote() {
git fetch -p && \
for branch in $(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}');
do git branch -d $branch;
done
}
alias gfuckit='git commit --amend --no-edit && gpf'
## SSH Agent
if [ -z "$SSH_AUTH_SOCK" ]; then
# Check for a currently running instance of the agent
RUNNING_AGENT="`ps -ax | grep 'ssh-agent -s' | grep -v grep | wc -l | tr -d '[:space:]'`"
if [ "$RUNNING_AGENT" = "0" ]; then
# Launch a new instance of the agent
ssh-agent -s &> .ssh/ssh-agent
fi
eval `cat .ssh/ssh-agent`
fi
# fnm
export PATH=$HOME/.fnm:$PATH
eval "$(fnm env --use-on-cd --version-file-strategy=recursive)"
alias "nvm"="fnm"
# Yarn
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
## Rust
. "$HOME/.cargo/env"
CARGO_NAME="Josh Buckland"
CARGO_EMAIL="josh.russell.buckland@gmail.com"
export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
## Go
export GOPATH=$(go env GOPATH)
export PATH="$GOPATH/bin:$PATH"
## Elixir/Erlang
# asdf
. /opt/homebrew/opt/asdf/libexec/asdf.sh
# elixir/erlang
export ERL_AFLAGS="-kernel shell_history enabled"
# opam configuration
[[ ! -r /Users/joshbuckland/.opam/opam-init/init.zsh ]] || source /Users/joshbuckland/.opam/opam-init/init.zsh > /dev/null 2> /dev/null
# Optional Config
## KrakenFlex config
test -f $HOME/.zshrc-kf && source $HOME/.zshrc-kf
## secrets
test -f $HOME/.dotfiles/secrets && source $HOME/.dotfiles/secrets
# zsh-completions
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh-completions:$FPATH
autoload bashcompinit && bashcompinit
autoload -Uz compinit && compinit
fi
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh