-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathzshrc
210 lines (174 loc) · 4.31 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
#
# General
#
ZSH_THEME="powerlevel10k/powerlevel10k"
export ZSH=$HOME/oh-my-zsh
source $ZSH/oh-my-zsh.sh
#
# History
#
export HISTSIZE=100000
export HISTFILE="$HOME/.history"
export SAVEHIST=$HISTSIZE
#
# Pyenv Virtualenv
#
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
#
# Vim Stuff
#
# Make Vi mode transitions faster (KEYTIMEOUT is in
# hundredths of a second)
export KEYTIMEOUT=1
export CDPATH="$HOME:$HOME/repos"
export GREP_COLOR="auto"
#
# Aliases
#
# reload .zshrc file
alias zshconfig="source ~/.zshrc"
# edit zsh theme
alias zshtheme="vim ~/repos/dotfiles/zsh/brandor.zsh-theme"
# use neovim
alias vim='nvim'
# edit .vimrc
alias vimrc="vim ~/repos/dotfiles/vim/.vimrc"
# edit ~/.config/nvim/init.vim
alias vinit='vim ~/.config/nvim/init.vim'
# edit .zshrc
alias zshrc="vim ~/repos/dotfiles/zsh/.zshrc"
# edit zsh custom theme
alias zshtheme="vim ~/repos/dotfiles/zsh/brandor.zsh-theme"
alias c="clear"
alias ll="ls -l"
alias lal="ls -al"
alias chrome="open -a /Applications/Google\ Chrome.app"
alias notes="vim ~/.notes"
alias dfs="cd ~/repos/dotfiles"
alias ..="cd .."
alias untar="tar -zxvf"
alias g="git"
alias gsl="git stash list"
alias gsc="git stash clear"
# Pretty Print $PATH
# gsed works with newlines (brew install gsed)
alias ppath="echo $PATH | gsed 's/:/\n/g' | sort"
# Do this first
alias yarn-upgrade="yarn upgrade-interactive --latest"
# Then do this :)
alias yarn-reset="rm -rf node_modules/; rm -f yarn.lock; yarn"
#
# SFDO Specific
#
alias metaci="c; cd ~/repos/metaci; source env; bin/unpack-node"
alias cumulusci="c; cd ~/repos/cumulusci"
alias metadeploy="c; cd ~/repos/metadeploy; source env; bin/unpack-node"
alias metashare="c; cd ~/repos/metashare"
alias npsp="c; cd ~/repos/npsp"
alias statusite="c; cd ~/repos/statusite"
#
# CumulusCI
#
alias ccilog='vim ~/.cumulusci/logs/cci.log'
alias ccfi='cci flow info'
alias ccfl='c; cci flow list'
alias ccfr='c; cci flow run'
alias ccob='c; cci org browser'
alias ccoc='c; cci org connect'
alias ccod='c; cci org default'
alias ccoi='c; cci org info'
alias ccol='c; cci org list'
alias ccor='c; cci org remove'
alias ccos='c; cci org scratch'
alias ccsd='c; cci org scratch_delete'
alias ccrm='c; cci org scratch_delete'
alias ccpc='c; cci project cd'
alias ccpd='c; cci project dependencies'
alias ccpi='c; cci project info'
alias ccpl='c; cci project list'
alias ccsc='c; cci service connect'
alias ccsl='c; cci service list'
alias ccss='c; cci service show'
alias cctd='c; cci task doc'
alias ccti='cci task info'
alias cctl='c; cci task list'
alias cctr='c; cci task run'
alias ccupg='c; pip install --upgrade cumulusci'
# grep for task
function gft() {
cci task list | grep $1
}
# grep for flow
function gff() {
cci flow list | grep $1
}
# pytest run failed command
function pt() {
python -m pytest $1 -l --disable-warnings
}
# run shell command through cci
function ccicmd() {
cci task run command -o command eval($1)
}
# grep task config
function gtc() {
cci_scroll="
___________________
()==( (@==()
'__________________'|
| |
| cumulusci.yml |
__)_________________|
()==( (@==()
'------------------'"
echo $cci_scroll
grep \ $1\: /Users/brandon.parker/repos/cumulusci/cumulusci/cumulusci.yml -A 15 -n
}
#
# git
#
alias clean_branches='git branch --merged | egrep -v "(^\*|master)" | xargs git branch -d'
function gc() {
git commit -m $1
}
#
# python doc search
#
function pds() {
chrome "https://docs.python.org/3/search.html?q=$1&check_keywords=yes&area=default"
}
#
# django doc search
#
function dds() {
chrome "https://docs.djangoproject.com/en/3.1/search/?q=$1"
}
function gds() {
chrome "https://www.git-scm.com/search/results?search=$1"
}
# ls -A after cd'ing
function chpwd() {
ls -A
}
function metacib {
/usr/bin/open -a "/Applications/Google Chrome.app" https://mrbelvedereci.herokuapp.com/builds/$1
}
#
# Plugins
#
plugins=(
git colored-man-pages
)
# Clone a repo and cd into it
gccd() {
if (( $# != 1 )); then
echo "Git repo url is required. Example: git@github.com:org/repo.git" && exit;
fi
# grab directory off git url
DIR=$(echo "$1" | awk -F '[/.]' '{print $4}');
# clone repo
git clone "$1";
# cd into cloned repo
cd "$DIR" || exit 0;
}