-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
217 lines (159 loc) · 6.32 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
216
217
# Path to your oh-my-zsh configuration.
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="agnoster"
DEFAULT_USER="ev"
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"
# Uncomment this to disable bi-weekly auto-update checks
# DISABLE_AUTO_UPDATE="true"
# Uncomment to change how often before auto-updates occur? (in days)
# export UPDATE_ZSH_DAYS=13
# Uncomment following line if you want to disable colors in ls
# DISABLE_LS_COLORS="true"
# Uncomment following line if you want to disable autosetting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment following line if you want to disable command autocorrection
# DISABLE_CORRECTION="true"
# Uncomment following line if you want red dots to be displayed while waiting for completion
# COMPLETION_WAITING_DOTS="true"
# Uncomment following line if you want to disable marking untracked files under
# VCS as dirty. This makes repository status check for large repositories much,
# much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# 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)
plugins=()
plugins+=(autojump)
plugins+=(bower)
plugins+=(brew)
plugins+=(Composer)
plugins+=(git)
plugins+=(git-flow)
plugins+=(osx)
plugins+=(sublime)
plugins+=(zsh-nvm)
source $ZSH/oh-my-zsh.sh
# Aliases
## Mac
alias showHidden='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app'
alias hideHidden='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app'
## RGB
alias ssh_public='ssh -i ~/.ssh/rgb_rackspace_rsa01 [email protected]'
alias ssh_staging='ssh -i ~/.ssh/rgb_rackspace_rsa01 [email protected]'
alias ssh_staging2='ssh -i ~/.ssh/rgb_rackspace_rsa01 [email protected]'
alias grab_public_config='scp -i ~/.ssh/rgb_rackspace_rsa01 [email protected]:/var/www/rgbnotes/config.php ~/Documents/RGB_configs/config.public.php'
alias grab_old_staging_config='scp -i ~/.ssh/rgb_rackspace_rsa01 [email protected]:/var/www/rgbnotes/config.php ~/Documents/RGB_configs/config.OLDstaging.php'
alias grab_staging_config='scp -i ~/.ssh/rgb_rackspace_rsa01 [email protected]:/var/www/rgbnotes/config.php ~/Documents/RGB_configs/config.staging.php'
# Executable PATHS
# export PATH=/Users/ev/local/bin:/usr/local/bin:/usr/local/heroku/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/deployd/bin:/usr/local/git/bin:$PATH
export PATH=$PATH:/bin
export PATH=$PATH:/sbin
export PATH=$PATH:/usr/bin
export PATH=$PATH:/usr/sbin
export PATH=$PATH:/usr/local/bin
export PATH=$PATH:/usr/local/bin
export PATH=$PATH:/usr/local/deployd/bin
export PATH=$PATH:/usr/local/git/bin
export PATH=$PATH:/usr/local/heroku/bin
export PATH=$PATH:~/Library/Python/3.5/bin
export PATH="$PATH:`yarn global bin`"
# ------------------------------------
# Python
# ------------------------------------
# Simple python webserver
function server() {
local port="${1:-8000}"
open "http://localhost:${port}/"
python -m SimpleHTTPServer "$port"
}
alias server=server
# Virtual Env
alias ve2='virtualenv -p python2 .'
alias ve3='virtualenv -p python3 .'
alias vestart='source ./bin/activate'
alias vestop='deactivate'
# ------------------------------------
# General
# ------------------------------------
alias ea='st ~/.zshrc'
alias sa='source ~/.zshrc'
alias web='cd ~/Documents/projects/web'
alias design='cd ~/Documents/projects/design'
# Create patch file from all staged items in current git repo.
# The file name will be labeled with the current commit hash.
gitpatch() {
hash="$(git rev-parse --short HEAD)"
if [ -z "$hash" ]
then
echo "No git commit hash was found"
else
git diff --cached --binary > ${hash}.patch
fi
}
# ------------------------------------
# Docker alias and function
# ------------------------------------
# ------------------------------------
# Docker Machine
# - deprecated in favor of Docker for Mac
# ------------------------------------
## Start default Docker Machine
# dmcreate() { docker-machine create --driver virtualbox default }
# dmstart() { docker-machine start default }
# dmrestart() { docker-machine restart default }
## Set Docker Machine Env
# dmenv() { eval "$(docker-machine env default)" }
## Launch Docker Machine
# dmhttp() { open http://$(docker-machine ip default)$1 }
# dmhttps() { open https://$(docker-machine ip default)$1 }
## Automaticaly set Docker Machine env in new tabs
# dmenv
# ------------------------------------
# Docker
# ------------------------------------
# Get latest container ID
alias dl="docker ps -l -q"
# Get container process
alias dps="docker ps"
# Get process included stop container
alias dpa="docker ps -a"
# Get images
alias di="docker images"
# Get container IP
alias dip="docker inspect --format '{{ .NetworkSettings.IPAddress }}'"
# Run deamonized container, e.g., $dkd base /bin/echo hello
alias dkd="docker run -d -P"
# Run interactive container, e.g., $dki base /bin/bash
alias dki="docker run -i -t -P"
# Execute interactive container, e.g., $dex base /bin/bash
alias dex="docker exec -i -t"
# Stop all containers
dstop() { docker stop $(docker ps -a -q); }
# Remove all containers
drm() { docker rm $(docker ps -a -q); }
# Stop and Remove all containers
alias drmf='docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)'
# Remove images
alias drmi="docker rmi"
# Remove all images
dri() { docker rmi $(docker images -q); }
# Dockerfile build, e.g., $dbu tcnksm/test
dbu() { docker build -t=$1 .; }
# Show all alias related docker
dalias() { alias | grep 'docker' | sed "s/^\([^=]*\)=\(.*\)/\1 => \2/"| sed "s/['|\']//g" | sort; }
# Attach Container
dattach() { docker exec -i -t $1 bash }
# Follow Container Log
alias dfollow="docker logs --follow"
export PATH="/usr/local/opt/mysql-client/bin:$PATH"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion