-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
224 lines (177 loc) · 6.05 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
218
219
220
221
222
223
224
# 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="avit"
# 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)
# LS colors, made with http://geoff.greer.fm/lscolors/
export LSCOLORS="exfxcxdxbxegedabagacad"
export LS_COLORS='di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=34;46:cd=34;43:su=0;41:sg=0;46:tw=0;42:ow=0;43:'
export GREP_COLOR='1;33'
plugins=(git bundler ruby rails history rake)
export PATH="$HOME/.rbenv/bin:$PATH"
local spacer_colour="%{$fg[white]%}"
local dir='%{$fg[cyan]%}%3~'
local return='%(?.%{$fg[green]%}✔%{$reset_color%}.%{$fg[red]%}✗)'
local pre_prompt='%{$fg_bold[white]%}->%{$reset_color%}'
rbenv_version() {
rbenv version 2>/dev/null | awk '{print $1}'
}
local rbenv='%{$fg[blue]%}[$(rbenv_version)]%{$reset_color%}'
local git='$(git_prompt_status) $(git_prompt_ahead) $(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%}✚ "
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}⚑ "
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✖ "
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}▴ "
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[cyan]%}§ "
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%}◒ "
if [[ $USER == "root" ]]; then
CARETCOLOR="red"
else
CARETCOLOR="white"
fi
# alias
# deploy
function go() {
ssh ubuntu@$* -i ~/.ssh/naharna-key.pem
}
function go1() {
ssh ubuntu@$* -i ~/.ssh/ihjoz2-key
}
alias p='git push origin `git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3`'
alias deploy='git push && gco production && git rebase master && git push origin production --force && cap deploy && gco master'
alias deploy1='git push && gco production && git rebase master && r assets:precompile && gaa && gca -m "Precompiled assets" && git push origin production --force && cap deploy && gco master'
# Command Enhancements
#ssh
alias iaas_panel='ssh deployer@cc.devnet.by'
alias billing_demo='ssh activebilling@my.active.by'
# Utility
alias reload='source ~/bin/dotfiles/bash/aliases'
alias ea='subl ~/bin/dotfiles/bash/aliases && reload' # Edit aliases
alias ee="subl ~/bin/dotfiles/bash/env"
# Quicker cd
function cr() {
cd ~/Projects/$*
}
# Common -- Some are from Damian Conway
alias a='ls -A' # -A all except literal . ..
alias la="ls -A -l -G"
alias c='clear'
alias cdd='cd -' # goto last dir cd'ed from
alias cl='clear; l'
function cdc() {
cd $1; ls
}
alias cls='clear; ls'
alias h='history'
alias l.='ls -d .[^.]*'
alias l='ls -lhGt' # -l long listing, most recent first
# -G color
alias lh="ls -lh"
alias ll='ls -lhG' # -l long listing, human readable, no group info
alias lt='ls -lt' # sort with recently modified first
alias md='mkdir -p'
alias s='cd ..' # up one dir
alias ceup='rm -rf ~/Projects/core/vendor/engines/cloud_express_plugin && cp -rf ~/Projects/cloud_express_plugin ~/Projects/core/vendor/engines'
alias e='exit'
alias k9="killall -9"
function killnamed () {
ps ax | grep $1 | cut -d ' ' -f 2 | xargs kill
}
# Finder
alias o='open . &'
# Processes
alias tu='top -o cpu' # cpu
alias tm='top -o vsize' # memory
# Git
alias ungit="find . -name '.git' -exec rm -rf {} \;"
alias ga='git add'
alias gba='git branch -a'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gcam='git commit --amend'
alias gaa='git add .'
# Commit pending changes and quote all args as message
function gg() {
git commit -v -a -m "$*"
}
alias gd='git diff'
alias gdm='git diff master'
alias gpr='g pull --rebase origin master'
alias gnp="git-notpushed"
alias gp='git push'
alias gst='git status'
alias gt='git status'
alias g='git'
alias glog='git log'
alias p='git push origin `git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3`'
alias master='gco master'
alias prod='gco production'
alias eg='vim .git/config'
# Git clone from GitHub
function gch() {
git clone git://github.com/$USER/$1.git
}
alias gb='git branch'
alias gba='git branch -a'
# Commit pending changes and quote all args as message
function gg() {
git commit -v -a -m "$*"
}
alias gco='git checkout'
alias gd='git diff'
alias gdm='git diff master'
alias gl='git pull'
alias gnp="git-notpushed"
alias gp='git push'
# Git clone from GitHub
function gch() {
git clone git://github.com/$USER/$1.git
}
# Ruby
alias r="rake"
alias rdd= 'r db:drop'
alias rdc= 'r db:create'
alias rdm= 'r db:migrate'
alias rds= 'r db:seed'
alias rdtp= 'r db:test:prepare'
alias redb='rdd && rdc && rdm && rds && rdtp'
alias reseed='rdd && rdc && rdm && rds'
# Rails
alias rc='rails console'
alias rs='rails server'
source $ZSH/oh-my-zsh.sh
source $HOME/.zshenv
PROMPT="${dir} ${return} ${pre_prompt} "
RPROMPT="${git} ${rbenv}"
unsetopt correct_all
export EDITOR=vim