-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
179 lines (150 loc) · 5.79 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
#
# Executes commands at the start of an interactive session.
#
# Authors:
# Sorin Ionescu <[email protected]>
#
# eval "$(rbenv init -)"
export TERM=xterm-256color
export EDITOR=vim
export ARCHFLAGS="-arch arm64"
unset -v GEM_HOME # https://discourse.brew.sh/t/why-does-tmuxinator-sets-gem-home/7296/3
# export GEM_HOME='$HOME/.asdf/plugins/ruby/lib/gems/'
bindkey -v
# with sudo: password entry, w/o sudo: permission denied :(
# sudo ifconfig lo0 alias 192.168.100.1
plugins=(docker)
export RUBYOPT='-W0'
export ASDF_RUBY_BUILD_VERSION=master
export DEBUG_PRINT_LIMIT=10000
export DATABASE_URL="postgres://postgres:postgres@localhost:5432"
# export POSTGRES_URL="postgres://postgres:postgres@localhost:5432"
# export DB_USER="postgres"
export AWS_ACCESS_KEY_ID=`awk -F "=" '/aws_access_key_id/ {print $2}' ${HOME}/.aws/credentials |tail -1 | xargs`
export AWS_SECRET_ACCESS_KEY=`awk -F "=" '/aws_secret_access_key/ {print $2}' ${HOME}/.aws/credentials |tail -1 | xargs`
export AWS_SESSION_TOKEN=`awk -F "=" '/aws_session_token/ {print $2}' ${HOME}/.aws/credentials |tail -1 | xargs`
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
# UTF-8 support
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# export DOCKER_BUILDKIT=0
# Powerline
# source /usr/local/lib/python2.7/site-packages/powerline/bindings/zsh/powerline.zsh
# aliases
alias a="say -v 'Anna'"
alias y="say -v 'Yuri'"
alias b="bundle"
alias be="b exec"
alias bert="ENV=test RAILS_ENV=test RACK_ENV=test ber test"
alias bers="ENV=test RAILS_ENV=test RACK_ENV=test ber spec"
alias ber="be rake"
alias beru="ENV=test RAILS_ENV=test RACK_ENV=test ber unit"
alias beri="ENV=test RAILS_ENV=test RACK_ENV=test ber integration"
alias berui="ENV=test RAILS_ENV=test RACK_ENV=test ber unit integration"
alias beg="be guard"
alias pret="rbprettier --write **/*.rb"
alias brewup="brew update && brew upgrade && brew cleanup"
alias br="br -s"
alias dc="docker compose"
alias dcu="dc up"
alias dcs="dc stop"
alias dcl="dc logs -f"
alias dcb="dc build"
alias dct="dc run app test"
alias dcbt="docker-compose build && docker-compose run app test"
alias dp="docker system prune -f && docker rmi -f `docker images | awk '{if (NR!=1) {print $3}}' | tr '\n' ' '`"
alias gitalias="vim $HOME/.zprezto/modules/git/alias.zsh"
alias src="cd ~/source/"
alias vimbash="vim ~/.bash_profile"
alias vimrc="vim ~/.vimrc"
alias zshrc="vim ~/.zprezto/runcoms/zshrc"
alias tmuxconf="vim ~/.tmux.conf"
alias brewfile="vim ~/Brewfile"
alias vimprezto="vim ~/.zpreztorc"
alias readme="vim ./README.md"
alias drainfile="vim ~/.drainfile"
alias nginxconf="vim /Users/thomas/source/local/nginx.conf"
alias changelog="cd ~/source/iwfm-pkg && git pull && cd - && vim ~/source/iwfm-pkg/CHANGELOG.md"
alias release="grep -m 1 --colour=never 'build-' ~/source/iwfm-pkg/CHANGELOG.md"
alias maik="netstat -anv | grep LISTEN"
alias maikrabbitmq="maik | grep 5672"
alias maikpostgres="maik | grep 5432"
alias maikredis="maik | grep 6379"
alias vimdel="find . -type f -name '*.sw[klmnop]' -delete"
alias curl="/usr/bin/curl -A \"Thomas M. Macbook\" $@"
alias ls='exa -lg'
alias ll='exa -lga'
alias localip='ifconfig | grep -Eo '\''inet (addr:)?([0-9]*\.){3}[0-9]*'\'' | grep -Eo '\''([0-9]*\.){3}[0-9]*'\'' | grep -v '\''127.0.0.1'\'
alias yolo='rm -rf node_modules/ && rm package-lock.json && yarn install'
alias loki='~/bin/logcli-darwin-amd64'
alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]"'
alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'
alias t='tmux new-session -n ""'
alias yarn1='cd $HOME && yarn set version 1.22.10 > /dev/null && echo "$(yarn -v)" && cd -'
alias yarn2='cd $HOME && yarn set version berry > /dev/null && echo "$(yarn -v)" && cd -'
alias vi="vim"
alias vs="vim -S"
alias ct="ctags -R --exclude=.git --exclude=node_modules"
alias mr="$HOME/source/maintenance-helper/maintain-ruby.rb"
function ghi () {
gh issue view https://github.com/ivx/injixo/issues/$1 --comments
}
# autojump
[ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh
# for local WP development:
alias wp="docker-compose run --rm wp-cli"
# global aliases
alias -g gp='| grep -i'
fpath=(~/.zsh/completion $fpath)
autoload -Uz compinit promptinit colors edit-command-line vcs-info
colors
compinit -i
promptinit
zle -N edit-command-line
# source ${HOME}/source/dotfiles/zsh-lcars-theme.sh
# source ${HOME}/.bin/tmuxinator.zsh
export SPACESHIP_USER_SHOW=false
export SPACESHIP_HOST_SHOW=false
export SPACESHIP_NODE_SHOW=false
export SPACESHIP_DOCKER_SHOW=false
export SPACESHIP_PACKAGE_SHOW=false
export SPACESHIP_KUBECONTEXT_SHOW=false
export SPACESHIP_TIME_SHOW=true
export SPACESHIP_DIR_COLOR=5
export SPACESHIP_GIT_BRANCH_COLOR=33
export SPACESHIP_GIT_STATUS_COLOR=162
export SPACESHIP_BATTERY_SHOW=true
export SPACESHIP_BATTERY_TRESHOLD=50
export SPACESHIP_VI_MODE_COLOR=185
prompt spaceship
if [ $commands[kubectl] ]; then
source <(kubectl completion zsh)
fi
# Tmux {{{
# Makes creating a new tmux session (with a specific name) easier
function tmuxopen() {
tmux attach -t $1
}
# Makes creating a new tmux session (with a specific name) easier
function tmuxnew() {
tmux new -s $1
}
# Makes deleting a tmux session easier
function tmuxkill() {
tmux kill-session -t $1
}
# }}}
# restore C-a and C-e for moving on line
# bindkey -e
# source "$HOME/.zsh/zsh-vim-mode/zsh-vim-mode.plugin.zsh"
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
zstyle ':completion:*:descriptions' format '[%d]'
# Setting rg as the default source for fzf (respects .gitgnore by default)
export FZF_DEFAULT_COMMAND='rg --files'
# To apply the command to CTRL-T as well
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
# overwrite precmd that sets the custom RPROMPT from tklepzig
# precmd() {}