-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
184 lines (146 loc) · 7.08 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
###############################################################################
## Shell config & aliases
###############################################################################
# Enter directory by typing its name.
# Also go up a directory with ..
setopt autocd
# Alias to quickly edit zsh config
alias zshconf="nvim ~/.zshrc"
alias zshsource="source ~/.zshrc"
alias exa='exa --long --header --git' # Show exa output in long format with headers and Git info
alias fs='foreman start -f Procfile' # Start Rails w/ Foreman
alias grep='grep --color=auto' # Make grep pretty
alias lg='lazygit'
alias ll="lsd"
alias lsd="lsd -lah"
alias myip='curl http://ipecho.net/plain; echo' # Print your current public IP address
alias nvimconf='nvim ~/.config/nvim/init.lua'
alias kittyconf='nvim ~/.config/kitty'
# Fix backspaces not working when ssh'ing to a server
[ "$TERM" = "xterm-kitty" ] && alias ssh="kitty +kitten ssh"
alias vi='nvim'
alias vim='nvim'
# Make commands verbose
alias cp="cp -v"
alias mv="mv -v"
# AWS
# Set 'default' AWS profile; refer to ~/.aws/config for list of profiles
export AWS_PROFILE="dev-poweruser"
# Ruby/Rails
alias rspec='bundle exec rspec'
alias rc='stty sane && bundle exec rails c'
alias sidekiq='bundle exec sidekiq'
# Git
alias glog='git log --graph --decorate --pretty=oneline --abbrev-commit' # Show a cool graph of git commit history
alias gst='git status'
alias gsw='git switch'
alias gco='git commit'
alias gad='git add'
# Chord
alias cd-chord='cd ~/Code/chord-oms'
alias chord-oms-staging="heroku run 'rails c -- --noautocomplete' --app chord-oms-staging"
# alias chord-oms-prod="heroku run 'rails c -- --noautocomplete' --app chord-oms-prod"
alias chord-oms-prod="heroku run 'rails c' --app chord-oms-prod"
alias chord-heroku-staging="heroku run '/bin/bash' --app chord-oms-staging"
alias chord-heroku-prod="heroku run '/bin/bash' --app chord-oms-prod"
alias bbc-oms-staging="heroku run 'rails c -- --noautocomplete' --app bbc-oms-staging"
alias bbc-oms-prod="heroku run 'rails c -- --noautocomplete' --app bbc-oms-prod"
alias bbc-oms-prod-sandbox="heroku run 'rails c -- --sandbox --noautocomplete' --app bbc-oms-prod"
alias hub-backend-staging="heroku run 'rails c -- --noautocomplete' --app hub-backend-staging"
## Chord CDP
alias cdp-dev="cd ~/Code/cdp/environments/development && export AWS_PROFILE=dev-administrator && aws sso login"
alias cdp-staging="cd ~/Code/cdp/environments/staging && export AWS_PROFILE=staging-administrator && aws sso login"
alias cdp-prod="cd ~/Code/cdp/environments/production && export AWS_PROFILE=prod-administrator && aws sso login"
export VISUAL=nvim
#--------------------------------------------------------------------#
# vim/Neovim/Lazyvim #
#--------------------------------------------------------------------#
export PATH=/Users/johnpitchko/.local/bin:$PATH
export NVIMHOME="$HOME/.config/nvim"
# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
export EDITOR='nvim'
fi
###############################################################################
## Homebrew
###############################################################################
export PATH="/usr/local/sbin:$PATH"
# Necessary because Homebrew installs packages to different directories on Intel and ARM computers!
export BREW_PATH=$(brew --prefix)
if type brew &>/dev/null
then
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
autoload -Uz compinit
compinit
fi
# asdf
. $(brew --prefix asdf)/libexec/asdf.sh
# $(brew --prefix asdf)/etc/bash_completion.d/asdf.bash
###############################################################################
## Ruby
###############################################################################
# Link Rubies to Homebrew's OpenSSL 1.1 instead of 3.x (directed from rbenv install)
# export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix [email protected])"
# Disable Spring
export DISABLE_SPRING=1
###############################################################################
###############################################################################
# There are multiple versions of Python 3 installed, so put the most recent one first on the PATH.
export PATH="$BREW_PATH/opt/[email protected]/bin:$PATH"
# Use the binaries in 3.10
export PATH="$BREW_PATH/opt/[email protected]/libexec/bin:$PATH"
###############################################################################
###############################################################################
export PATH="$BREW_PATH/opt/[email protected]/bin:$PATH"
export LDFLAGS="-L$BREW_PATH/opt/[email protected]/lib"
export CPPFLAGS="-I$BREW_PATH/opt/[email protected]/include"
export PKG_CONFIG_PATH="$BREW_PATH/opt/[email protected]/lib/pkgconfig"
###############################################################################
## postgresql
###############################################################################
export PATH="$BREW_PATH/opt/postgresql@15/bin:$PATH"
export LDFLAGS="-L$BREW_PATH/opt/postgresql@15/lib"
export CPPFLAGS="-I$BREW_PATH/opt/postgresql@15/include"
export PKG_CONFIG_PATH="$BREW_PATH/opt/postgresql@15/lib/pkgconfig"
# Chord OMS uses Postgresql v13, so maintain the paths here.
export PATH="$BREW_PATH/opt/postgresql@13/bin:$PATH"
export LDFLAGS="-L$BREW_PATH/opt/postgresql@13/lib"
export CPPFLAGS="-I$BREW_PATH/opt/postgresql@13/include"
export PKG_CONFIG_PATH="$BREW_PATH/opt/postgresql@13/lib/pkgconfig"
###############################################################################
## mysql
###############################################################################
export PATH="$BREW_PATH/opt/[email protected]/bin:$PATH"
export LDFLAGS="-L$BREW_PATH/opt/[email protected]/lib"
export CPPFLAGS="-I$BREW_PATH/opt/[email protected]/include"
export PKG_CONFIG_PATH="$BREW_PATH/opt/[email protected]/lib/pkgconfig"
###############################################################################
## Node
###############################################################################
export PATH="$BREW_PATH/opt/node@16/bin:$PATH"
export LDFLAGS="-L$BREW_PATH/opt/node@16/lib"
export CPPFLAGS="-I$BREW_PATH/opt/node@16/include"
###############################################################################
## Stripe CLI
###############################################################################
fpath=(~/.stripe $fpath)
autoload -Uz compinit && compinit -i
###############################################################################
## Rust
###############################################################################
export PATH="/Users/johnpitchko/.cargo/bin:$PATH"
#--------------------------------------------------------------------#
# Redis #
#--------------------------------------------------------------------#
export PATH="$BREW_PATH/opt/[email protected]/bin:$PATH"
## Bison
export PATH="$BREW_PATH/opt/bison/bin:$PATH"
export LDFLAGS="-L$BREW_PATH/opt/bison/lib"
## Starship
# Must be last line in .zshrc!
eval "$(starship init zsh)"