Repository navigation
Expand file tree
/
Copy pathzshrc
More file actions
117 lines (101 loc) · 2.8 KB
/
Copy pathzshrc
File metadata and controls
117 lines (101 loc) · 2.8 KB
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
export ZSH=~/.oh-my-zsh
ZSH_THEME="speric"
CASE_SENSITIVE="true"
plugins=()
source $ZSH/oh-my-zsh.sh
typeset -U path
path+=(
${HOME}/.rvm/bin
${HOME}/dev/dotfiles/bin
/usr/local/opt/mysql@5.6/bin
/usr/local/opt/node@6/bin
/usr/local/sbin
)
export EDITOR="vi"
export FZF_DEFAULT_COMMAND='ag --hidden -g ""'
setopt auto_cd
cdpath=($HOME/dev)
# .localrc: for stuff you don't want
# in your public, versioned repo
if [[ -a ~/.localrc ]]
then
source ~/.localrc
fi
# Aliases
alias ag="ag --path-to-ignore ~/.agignore"
alias be="RUBYOPT=W0 bundle exec"
alias clint="(cd frontend && npm run lint)"
alias console="bin/rails console"
alias cuke="bin/cucumber"
alias deploy="git co master && git pull && git push dokku master"
alias devtail="tail -f ./log/development.log"
alias effincamera="sudo killall VDCAssistant"
alias fe="(cd frontend && yarn start)"
alias flush_dns="sudo killall -HUP mDNSResponder; \
sudo killall mDNSResponderHelper; \
sudo dscacheutil -flushcache; \
sudo dscacheutil -flushcache; \
sudo killall -HUP mDNSResponder"
alias flush_redis="redis-cli flushall"
alias fr="flush_redis"
alias fs="foreman start"
alias gcm="git co master"
alias giton="git checkout"
alias mini="ruby -Ilib:test"
alias release="gcm && git pull && bin/rake release_notes | pbcopy"
alias reset_author="git commit --amend --reset-author"
alias reset_touchbar="pkill 'Touch Bar agent'; killall 'ControlStrip';"
alias rs="bin/rspec --no-profile" # --order defined
alias recent="git recent"
alias reload="source $HOME/.zshrc"
alias servers="fs --procfile=Procfile.local"
alias squash="git rebase -i master"
alias sr="bin/rspec --no-profile --tty"
alias srf="sr --only-failures"
alias tag="ctags -R \
--exclude=.git \
--exclude=app/assets/javascripts \
--exclude=app/views \
--exclude=artifacts \
--exclude=db \
--exclude=frontend \
--exclude=lib/console \
--exclude=log \
--exclude=spec \
--exclude=tmp \
--exclude=vendor \
--exclude=public \
."
alias testtail="tail -f ./log/test.log"
alias unhitch="hitch -u"
alias vi="vim"
# Functions
# Use `fzf` to browse/select a recent git branch
# h/t @jeremywrowe
cb() {
git checkout $(git short-recent | fzf)
}
fresh() {
git pull
git cleanup
bin/fresh
}
# From https://github.com/pengwynn/dotfiles/blob/master/zsh/window.zsh
# Sets the window title nicely no matter where you are
function title() {
# escape '%' chars in $1, make nonprintables visible
a=${(V)1//\%/\%\%}
# Truncate command, and join lines.
a=$(print -Pn "%40>...>$a" | tr -d "\n")
case $TERM in
screen)
print -Pn "\ek$a:$3\e\\" # screen title (in ^A")
;;
xterm*|rxvt)
print -Pn "\e]2;$2\a" # plain xterm title ($3 for pwd)
;;
esac
}
# source /usr/local/dev-env/ansible/mac_profile
# [ -n "$DESK_ENV" ] && source "$DESK_ENV" || true
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh