-
Notifications
You must be signed in to change notification settings - Fork 0
/
private_dot_zshrc.tmpl
137 lines (108 loc) · 3.2 KB
/
private_dot_zshrc.tmpl
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
plugins=(aphorism docker docker-compose git git-extras gitfast node npm rails vscode)
export ZSH="$HOME/.oh-my-zsh"
export CONFIGURE_ARGS="with-pg-config=/Applications/Postgres.app/Contents/Versions/latest/bin/pg_config"
# sets the editor for chezmoi to Visual Studio Code
export EDITOR="code --wait"
export HISTSIZE=1000000000
export SAVEHIST=$HISTSIZE
export GITHUB_TOKEN={{ (index (onepassword "Github Token").fields 0).value }}
setopt EXTENDED_HISTORY
##################
# Aliases #
##################
alias bi='bundle install'
alias be='bundle exec'
alias rbn='be rubocop'
alias rbf='be rubocop -a'
alias brff='be rubocop --format files'
alias brwp='be rubocop --format worst --format pacman'
alias tf='terraform'
alias tfs='terraform state'
alias notify='tput bel'
# Zsh
alias rezsh='source ~/.zshrc'
# Docker
alias dbuild='docker-compose up -d --build'
alias dup='docker-compose up -d'
alias ddown='docker-compose down'
alias drm='docker rm $(docker ps -a -q)'
alias dkill='docker system prune --all'
# Git
alias gcm='git cln master'
alias gcd='git cln develop'
function dclean() {
volumes=$(docker volume ls -q -f dangling=true)
images=$(docker images -q -f dangling=true)
if [[ $volumes ]] {
docker volume rm $volumes
}
if [[ $images ]] {
docker rmi $images
}
}
# unsets the nomatch error so we can run rake tasks like normal
unsetopt nomatch
# usage:
# whatisusing 3000
function whatisusing() {
lsof -i tcp:$1
}
# usage:
# dcop api
function dcop() {
docker-compose exec $1 bundle exec rubocop
}
# usage:
# dcopa api
function dcopa() {
docker-compose exec $1 bundle exec rubocop -a
}
# usage:
# dspec api
function dspec() {
docker-compose exec $1 bundle exec rspec
}
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
##################
# PATH additions #
##################
function addToPATH {
case ":$PATH:" in
*":$1:"*) :;; # already there
*) PATH="$1:$PATH";; # or PATH="$PATH:$1"
esac
}
# for earlier versions of Ruby on M1 Macs
addToPATH "/opt/homebrew/opt/openssl@1.1/bin"
addToPATH "$HOME/.pyenv/bin"
addToPATH "$HOME/.nodenv/bin"
addToPATH "$(ruby -r rubygems -e 'puts Gem.user_dir')/bin"
addToPATH "/usr/local/sbin"
addToPATH "/opt/homebrew/bin" # Add brew to path for M1 Chip
addToPATH "/opt/homebrew/opt/libpq/bin"
addToPATH "$HOME/.rbenv/bin"
addToPATH "$HOME/Library/Application Support/JetBrains/Toolbox/scripts"
export PATH
# for earlier versions of Ruby on M1 Macs
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)"
# for libpq to install the pg gem in ruby/rails apps
export PKG_CONFIG_PATH="/opt/homebrew/opt/libpq/lib/pkgconfig"
# initialize pyenv
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
else
echo "pyenv not installed"
fi
# initialize nodenv
if command -v nodenv 1>/dev/null 2>&1; then
eval "$(nodenv init -)"
else
echo "nodenv not installed"
fi
eval "$(rbenv init -)"
source $(brew --prefix)/opt/spaceship/spaceship.zsh
source $ZSH/oh-my-zsh.sh