-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
executable file
·215 lines (160 loc) · 5.92 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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
##########
# .zshrc for >=zsh-4.2.3
# written by Boris Smus <boris@smus.com>
#####
#
# Set the path proper
path=( ~/bin /opt/local/bin /usr/local/bin /sbin /usr/sbin /usr/bin $path )
# Set language
export LC_ALL="en_US.UTF-8"
# if we're on server, re-enter screen.
if [[ $HOST == "teleport" ]] && [[ $TERM != "screen" ]]
then
screen -r
export FROM_SSH=
fi
# Preferred Applications ##########
export EDITOR=`which vim`
export PAGER=`which less`
export MANPAGER=$PAGER
# Aliases ####################
alias ls="ls -F"
alias screen="screen -U"
# Shell options ############
# make cd push the old directory to the dirstack
setopt auto_pushd
# complete as much of a completion until it gets ambiguous.
setopt list_ambiguous
# cycle through globbing matches like menu_complete
setopt glob_complete
# bash-like completion options
setopt no_auto_menu
setopt no_menu_complete
setopt auto_list
# append every single command to $HISTFILE immediately after
# hitting ENTER.
setopt append_history
# save extended history
setopt extended_history
# save a lot of history
HISTSIZE=5000
SAVEHIST=5000
HISTFILE=~/.zshhistory
# Completion ###############
autoload -U compinit
compinit
# zmv
autoload zmv
# Enable caching
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zsh/cache
# Remove trailing slashes
zstyle ':completion:*' squeeze-slashes true
# Enable case-insensitive completion
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
# Replace the default completion (files) with hosts, for some commands
hosts=(
"$_etc_hosts[@]"
"$_ssh_known_hosts[@]"
localhost
)
compdef _hosts ssh ping
# Prompt ###################
autoload colors && colors
CYAN=%{$fg[cyan]%}
GREEN=%{$fg[green]%}
DEFAULT=%{$fg[default]%}
PROMPT="${CYAN}%n@%m ${GREEN}%~ $DEFAULT> "
# Key Bindings ###############
# Use mostly emacs bindings
bindkey -e
# Fix the delete key
bindkey "^[[3~" delete-char
# Complete in the middle of some text ignoring the suffix.
bindkey '^i' expand-or-complete-prefix
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
# NaCl Stuff ################
# Setup NaCl root.
export NACL_SDK_ROOT=$HOME/Tools/nacl_sdk/pepper_46/
export NACL_SDK_BIN=$NACL_SDK_ROOT/toolchain/mac_x86_newlib/bin/
export NACL_DEBUG_ENABLE=1
export PPAPI_BROWSER_DEBUG=1
export NACL_PLUGIN_DEBUG=1
export NACL_PPAPI_PROXY_DEBUG=1
export PATH=$PATH:$NACL_SDK_ROOT/toolchain/mac_pnacl/bin
# Setup depot tools for Chrome-related projects.
export PATH=$PATH:$HOME/Tools/depot_tools
# Homebrew stuff
export PATH=/usr/local/homebrew/bin:$PATH
# Ruby path.
export PATH=/usr/local/homebrew/Cellar/ruby/1.9.3-p286/bin:$PATH
# Node path.
export PATH=$PATH:/usr/local/homebrew/share/npm/bin
# Chromium use ninja.
export GYP_GENERATORS=ninja
# P4 config for mac.
export P4CONFIG=.p4config
export P4EDITOR=vim
# Pebble development.
export PATH=$PATH:~/Tools/pebble-dev/PebbleSDK-2.0-BETA5/bin
# Go
export PATH=$PATH:/usr/local/homebrew/Cellar/go/1.2.1/libexec/bin
# Tex
export PATH=$PATH:/usr/texbin
# Homebrew
export PATH=$HOME/homebrew/bin:$PATH
# Alias for blaze-run.
alias blaze-run=/google/src/head/depot/google3/devtools/blaze/scripts/blaze-run.sh
# TensorFlow development.
export PATH=/usr/local/cuda/bin:$PATH
export CUDA_HOME=/usr/local/cuda
# Updates PATH for the Google Cloud SDK.
if [ -f '/usr/local/google/home/smus/Downloads/google-cloud-sdk/path.zsh.inc' ]; then source '/usr/local/google/home/smus/Downloads/google-cloud-sdk/path.zsh.inc'; fi
if [ -f '/Users/smus/Downloads/google-cloud-sdk/path.zsh.inc' ]; then source '/Users/smus/Downloads/google-cloud-sdk/path.zsh.inc'; fi
# For Linux, a way to load npm without having to go through apt-get.
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
if [ -f /Users/smus/Downloads/google-cloud-sdk/completion.zsh.inc ]; then
source '/Users/smus/Downloads/google-cloud-sdk/completion.zsh.inc'
fi
# Mac SrcFS completion.
SRCFS_COMPLETION=/Library/GoogleCorpSupport/srcfs/shell_completion/enable_completion.sh
if [ -f $SRCFS_COMPLETION ]; then
source $SRCFS_COMPLETION
fi
# Handy aliases to do current work.
alias cda="cd /google/src/cloud/smus/albacore/google3"
# Easier batch renaming.
autoload -U zmv
alias mmv='noglob zmv -W'
export USB_DEVFS_PATH=/dev/bus/usb
# For google app credentials.
#export GOOGLE_APPLICATION_CREDENTIALS=$HOME/babelfish-454519da7006.json
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
# Cerebra project path.
alias cdc="cd ~/Projects/cerebra"
# Windows emulator stuff.
export WINEARCH=win32
export WINEPREFIX=~/.wine_d2
alias d2="cd ~/.wine_d2/drive_c/Program\ Files/Diablo\ II && wine game.exe -w -3dfx -nofixaspect"
# tabtab source for electron-forge package
# uninstall by removing these lines or running `tabtab uninstall electron-forge`
[[ -f /Users/boris/.nvm/versions/node/v13.10.1/lib/node_modules/electron-forge/node_modules/tabtab/.completions/electron-forge.zsh ]] && . /Users/boris/.nvm/versions/node/v13.10.1/lib/node_modules/electron-forge/node_modules/tabtab/.completions/electron-forge.zsh
# Support for Dart.
export PATH=/usr/lib/google-dartlang/bin:${PATH}
# On Linux, alias open to nautilus.
if [[ `uname` == 'Linux' ]]
then
alias open='nautilus'
fi
alias gvim='/Applications/MacVim.app/Contents/MacOS/Vim -g'
source ~/.zsh_secrets
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/smus/Downloads/google-cloud-sdk/path.zsh.inc' ]; then . '/Users/smus/Downloads/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/Users/smus/Downloads/google-cloud-sdk/completion.zsh.inc' ]; then . '/Users/smus/Downloads/google-cloud-sdk/completion.zsh.inc'; fi
[[ -e "/Users/smus/mdproxy/data/mdproxy_zshrc" ]] && source "/Users/smus/mdproxy/data/mdproxy_zshrc" # MDPROXY-ZSHRC
export LINUX_HOSTNAME=smus.sea.corp.google.com
alias fg3="/usr/local/lib/google-flutter/bin/flutter.sar"