forked from thoughtbot/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathzshrc.local
183 lines (150 loc) · 6.13 KB
/
zshrc.local
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
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
# plugins=(brew colored-man tmux tmuxinator git github git-extras git-flow docker rails bundler)
plugins=(brew tmux tmuxinator gitfast git-extras docker bundler z)
source $ZSH/oh-my-zsh.sh
# User configuration
export PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin"
# export MANPATH="/usr/local/man:$MANPATH"
path=(
./bin
vendor/bin
node_modules/.bin
$HOME/.bin
$HOME/.yarn/bin
$path
)
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
export EDITOR='nvim'
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# aliases
alias viv="nvim ~/.vimrc"
alias viz="nvim ~/.zshrc.local"
alias bs="brew services"
alias ee="exa --icons -l --time-style=long-iso"
alias ea="exa --icons -la --time-style=long-iso"
alias et="exa -T --long"
alias tmux="TERM=screen-256color-bce tmux"
alias tk="tmux kill-session"
# alias re="rbenv"
alias dk="docker"
alias dki="docker images"
alias dkrm="docker rmi --force"
alias dp="docker-compose"
alias de="dp exec"
alias dech="dp exec clickhouse clickhouse client -u default --password test"
alias dy="docker-sync"
alias ddp="dip compose"
# alias dm="docker-machine"
alias aa="asciinema"
alias ar="asciinema rec"
alias xjq="pbpaste | jq"
alias vjq="pbpaste | jq | vi -c 'set ft=json'"
alias af="asdf"
alias afgd="asdf shell ruby 2.5.1"
alias yg="you-get -x 127.0.0.1:1087"
# if type nvim > /dev/null 2>&1; then
# fi
alias vi="nvim"
# alias art="php artisan"
# alias art:s="art serve"
# alias hd="homestead"
# alias sp="suspenders"
# alias gdsk="ssh-add -K ~/.ssh/id_rsa"
# alias gduat="ssh [email protected]"
# alias gdhff="ssh [email protected]"
# alias gdpg="pgcli -h postgres -u postgres -d goldendata_development"
# dev env
# alias tg="ctags -R --languages=Ruby,CoffeeScript --exclude=.git --exclude=log --exclude=tmp --exclude=dockerize . $(bundle list --paths)"
alias tg="ctags -R --languages=Ruby,CoffeeScript --exclude=.git --exclude=log --exclude=tmp --exclude=dockerize ."
# alias ctg="ctags -R --languages=ruby -f gems.tags $(bundle list --paths)"
alias pgl="pgcli -h 127.0.0.1 -U postgres"
# alias heroup="git push heroku master && heroku run rake db:migrate"
# alias pgup="postgres -D /usr/local/var/postgres"
# alias pgdown="brew services stop postgresql"
# alias myup="brew services start mysql"
# alias mydown="brew services stop mysql"
# alias gcup="cd ~/work/tw-projects/livetext/gcbase && docker-machine start livetext && docker-compose up -d"
# alias gcdown="cd ~/work/tw-projects/livetext/gcbase && docker-compose stop && docker-machine stop livetext"
# alias devup="mysql.server start && sudo /Applications/XAMPP/xamppfiles/bin/httpd -f /Applications/XAMPP/xamppfiles/etc/httpd.conf -k start"
# alias devdown="mysql.server stop && sudo /Applications/XAMPP/xamppfiles/bin/httpd -f /Applications/XAMPP/xamppfiles/etc/httpd.conf -k stop"
# alias gdup="brew services start [email protected] && brew services start redis && brew services start memcached && brew services start elasticsearch && brew services start postgresql"
# alias gddown="brew services stop [email protected] && brew services stop redis && brew services stop memcached && brew services stop elasticsearch && brew services stop postgresql"
# alias gduat="ssh [email protected] -p 32754"
# alias gdsta="ssh [email protected]"
# alias gdprod="ssh -A [email protected]"
# export PATH="$HOME/.rbenv/shims:$PATH"
# eval "$(rbenv init - zsh --no-rehash)"
# eval "$(rbenv init -)"
eval "$(/opt/homebrew/bin/brew shellenv)"
source ~/.bin/tmuxinator.zsh
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# Homebrew Bottles源的更换
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles/bottles
export HOMEBREW_NO_AUTO_UPDATE=1
export FZF_DEFAULT_OPTS="--height 50% --layout=reverse"
# . "/Users/xfyuan/.acme.sh/acme.sh.env"
source $(brew --prefix asdf)/libexec/asdf.sh
# Combinate z and fzf to jump folder quickly
unalias z 2> /dev/null
z() {
[ $# -gt 0 ] && zshz "$*" && return
cd "$(zshz -l 2>&1 | fzf --height 40% --nth 2.. --reverse --inline-info +s --tac --query "${*##-* }" | sed 's/^[0-9,.]* *//')"
}
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
}
pastefinish() {
zle -N self-insert $OLD_SELF_INSERT
}
zstyle :bracketed-paste-magic paste-init pasteinit
zstyle :bracketed-paste-magic paste-finish pastefinish
### Fix slowness of pastes
export HOMEBREW_NO_AUTO_UPDATE=1
# Golang
# export PATH="$PATH:$(go env GOPATH)/bin"
export GOPATH="$HOME/go"
export GOBIN="$GOPATH/bin"
export PATH=$PATH:$GOBIN
export GO111MODULE=on
export GOSUMDB='off'
# export GOPROXY=https://goproxy.cn
# export GOPRIVATE='*.sudiyi.cn'
export GOPRIVATE=git.5th.im
export GOPROXY=https://goproxy.dev.longbridge-inc.com
function bds() {
rg "$1" $(bundle show --paths)
}
export BOUNDARY_ADDR=https://boundary.longbridge-inc.com
alias bdlogin="boundary authenticate oidc -auth-method-id amoidc_VpLb47gMEG"
# longbridge config
export MICRO_SERVER_VERSION=1.0.0:local
export MICRO_REGISTRY=consul
export MICRO_CLIENT=lb
export MICRO_REGISTRY_ADDRESS=127.0.0.1:8500