/
.zshrc
121 lines (94 loc) · 2.34 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
###### Autoloads
autoload -U promptinit
autoload colors # named color arrays
colors
autoload -U compinit # tab completion
compinit
###### Options
setopt auto_cd # auto cd when dir name is typed
setopt cdablevars # cd into named vars
setopt prompt_subst # enable var expansion in prompt
setopt complete_in_word # when completing, keep cursor inline
setopt always_to_end # move cursor to end of word if match inserted
source ~/.zsh/title.zsh
# Force it into vi mode
set -o vi
###### Aliases
alias vim='/Applications/MacVim/mvim -v'
alias ll='/bin/ls -Gla'
alias gsp='git stash pop'
alias gf='git fetch'
alias w3='cd ~/Sites/within3/big_red'
alias gorails='cd ~/Programming/Rails'
alias goruby='cd ~/Programming/Ruby'
alias bctags='/usr/local/Cellar/ctags/5.8/bin/ctags'
alias rsu='time rspec spec/units'
###### Directory Shortcuts
big_red=~/Sites/within3/big_red
w3public=~/Sites/within3_public
code=~/Code/Active
vendor=~/Code/Vendor
###### Functions
cdk_api() {
rspec -t cdk_api -fd spec/units/cdk/$1
}
pless() {
pygmentize $1 | less -r
}
e() {
vim $*
}
reload() {
source ~/.zshenv
source ~/.zshrc
}
vpn() {
osascript ~/bin/vpn_connector.scpt
}
rvmpass() {
rvm $1 --passenger
sudo apachectl restart
}
gh() {
rvm 1.8.7 && github $* && rvm 1.9.1
}
dump_yamls() {
if [ -d $FILE ]; then
else
FILE=db/development
fi
FILE=$FILE TABLES=$1 rake w3:db:dump
}
whodoneit() {
for x in $(git grep --name-only $1); do
git blame -f -- $x | grep $1;
done
}
color-my-code() {
pygmentize -f rtf -O style=colorful $1 | pbcopy
}
# make meta+bksp kill path components
function backward-kill-partial-word {
local WORDCHARS="${WORDCHARS//[\/.]/}"
zle backward-kill-word "$@"
}
vack () {
vim $(ack -g $@)
}
runcuke() {
time cucumber features/acceptance -t $1
}
zle -N backward-kill-partial-word
bindkey '^Xw' backward-kill-partial-word
source ~/.zsh/history.zsh
source ~/.zsh/completions.zsh
source ~/.zsh/git.zsh
source ~/.zsh/title.zsh
###### Prompt
PS1="%n@%m:%~%# "
PROMPT='%{$fg_bold[red]%}%m%{$fg[white]%}:%{$fg[blue]%}%~ %{$fg_bold[yellow]%}$(git-prompt) %{$fg_bold[white]%}✈ %{$reset_color%}'
PROMPT='$(git-prompt)%{$fg_bold[white]%}✈ %{$reset_color%}'
promptinit
prompt jaf
###### rvm
if [[ -s /Users/adomokos/.rvm/scripts/rvm ]] ; then source /Users/adomokos/.rvm/scripts/rvm ; fi