914c47b3473b000288c693523f83fde998282a81
- Author
- Stephen Zhuang <stephen.zhuang@gmail.com>
- Committer
- Stephen Zhuang <stephen.zhuang@gmail.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/README.textile b/README.textile
2index a38e2d7cf83748f562590b4eb9383a827bc8d16f..0a4545bac277459e010242a976c097601d063979 100644
3--- a/README.textile
4+++ b/README.textile
5@@ -26,17 +26,20 @@ h3. The manual way
6
7 @git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
8
9-2. Create a new zsh config by copying the zsh template we've provided.
10+2. *OPTIONAL* Backup your existing ~/.zshrc file
11
12- *NOTE*: If you already have a ~/.zshrc file, you should back it up. @cp ~/.zshrc ~/.zshrc.orig@ in case you want to go back to your original settings.
13+ @cp ~/.zshrc ~/.zshrc.orig@
14+
15+3. Create a new zsh config by copying the zsh template we've provided.
16
17 @cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@
18
19-3. Set zsh as your default shell:
20+
21+4. Set zsh as your default shell:
22
23 @chsh -s /bin/zsh@
24
25-4. Start / restart zsh (open a new terminal is easy enough...)
26+5. Start / restart zsh (open a new terminal is easy enough...)
27
28 h3. Problems?
29
30diff --git a/lib/aliases.zsh b/lib/aliases.zsh
31index 0555be2642fcd73e6d4ced8bc44e7eee75e13607..a7f699c19f1ad76390e3b0be8cfafd81c521ca05 100644
32--- a/lib/aliases.zsh
33+++ b/lib/aliases.zsh
34@@ -8,6 +8,7 @@ alias -- -='cd -'
35
36 # Super user
37 alias _='sudo'
38+alias please='sudo'
39
40 #alias g='grep -in'
41
42@@ -16,8 +17,9 @@ alias history='fc -l 1'
43
44 # List direcory contents
45 alias lsa='ls -lah'
46-alias l='ls -la'
47+alias l='ls -lA1'
48 alias ll='ls -l'
49+alias la='ls -lA'
50 alias sl=ls # often screw this up
51
52 alias afind='ack-grep -il'
53diff --git a/lib/completion.zsh b/lib/completion.zsh
54index f31e101d5d2c9ad441af6468b8327b0c675997c8..ba839a067c81085e283c71cbd4ee4ead3c5a4727 100644
55--- a/lib/completion.zsh
56+++ b/lib/completion.zsh
57@@ -32,7 +32,7 @@ zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-dir
58 cdpath=(.)
59
60 # use /etc/hosts and known_hosts for hostname completion
61-[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
62+[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _global_ssh_hosts=()
63 [ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
64 [ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
65 hosts=(
66diff --git a/lib/directories.zsh b/lib/directories.zsh
67index a787db9ebda2664163bebd1a42ce4727801eef61..6c743e40ec943bbe3f188e187752e584c3bfa2db 100644
68--- a/lib/directories.zsh
69+++ b/lib/directories.zsh
70@@ -26,9 +26,9 @@ cd () {
71 elif [[ "x$*" == "x...." ]]; then
72 cd ../../..
73 elif [[ "x$*" == "x....." ]]; then
74- cd ../../..
75- elif [[ "x$*" == "x......" ]]; then
76 cd ../../../..
77+ elif [[ "x$*" == "x......" ]]; then
78+ cd ../../../../..
79 else
80 builtin cd "$@"
81 fi
82@@ -37,8 +37,3 @@ cd () {
83 alias md='mkdir -p'
84 alias rd=rmdir
85 alias d='dirs -v | head -10'
86-
87-# mkdir & cd to it
88-function mcd() {
89- mkdir -p "$1" && cd "$1";
90-}
91diff --git a/lib/functions.zsh b/lib/functions.zsh
92index d2dcadd0cb4d7235c8876556eb863140c315df12..63ab755cf72b1094975ef017cd71727c756e1943 100644
93--- a/lib/functions.zsh
94+++ b/lib/functions.zsh
95@@ -1,5 +1,5 @@
96 function zsh_stats() {
97- history | awk '{print $2}' | sort | uniq -c | sort -rn | head
98+ history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
99 }
100
101 function uninstall_oh_my_zsh() {
102diff --git a/lib/git.zsh b/lib/git.zsh
103index fb4ad8ca64ffbf7bcfd34ca82b1acbe8947d36bf..b1dfce3575489d10d007ad3970d5b469f26cfad8 100644
104--- a/lib/git.zsh
105+++ b/lib/git.zsh
106@@ -1,6 +1,7 @@
107 # get the name of the branch we are on
108 function git_prompt_info() {
109- ref=$(git symbolic-ref HEAD 2> /dev/null) || return
110+ ref=$(git symbolic-ref HEAD 2> /dev/null) || \
111+ ref=$(git rev-parse --short HEAD 2> /dev/null) || return
112 echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
113 }
114
115@@ -18,6 +19,25 @@ parse_git_dirty() {
116 fi
117 }
118
119+# get the difference between the local and remote branches
120+git_remote_status() {
121+ remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
122+ if [[ -n ${remote} ]] ; then
123+ ahead=$(git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
124+ behind=$(git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
125+
126+ if [ $ahead -eq 0 ] && [ $behind -gt 0 ]
127+ then
128+ echo "$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE"
129+ elif [ $ahead -gt 0 ] && [ $behind -eq 0 ]
130+ then
131+ echo "$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
132+ elif [ $ahead -gt 0 ] && [ $behind -gt 0 ]
133+ then
134+ echo "$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE"
135+ fi
136+ fi
137+}
138
139 # Checks if there are commits ahead from remote
140 function git_prompt_ahead() {
141@@ -38,7 +58,7 @@ function git_prompt_long_sha() {
142
143 # Get the status of the working tree
144 git_prompt_status() {
145- INDEX=$(git status --porcelain 2> /dev/null)
146+ INDEX=$(git status --porcelain -b 2> /dev/null)
147 STATUS=""
148 if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
149 STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
150@@ -60,18 +80,32 @@ git_prompt_status() {
151 fi
152 if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
153 STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
154+ elif $(echo "$INDEX" | grep '^D ' &> /dev/null); then
155+ STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
156 elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
157 STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
158 fi
159+ if $(git rev-parse --verify refs/stash >/dev/null 2>&1); then
160+ STATUS="$ZSH_THEME_GIT_PROMPT_STASHED$STATUS"
161+ fi
162 if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
163 STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
164 fi
165+ if $(echo "$INDEX" | grep '^## .*ahead' &> /dev/null); then
166+ STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS"
167+ fi
168+ if $(echo "$INDEX" | grep '^## .*behind' &> /dev/null); then
169+ STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS"
170+ fi
171+ if $(echo "$INDEX" | grep '^## .*diverged' &> /dev/null); then
172+ STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
173+ fi
174 echo $STATUS
175 }
176
177 #compare the provided version of git to the version installed and on path
178 #prints 1 if input version <= installed version
179-#prints -1 otherwise
180+#prints -1 otherwise
181 function git_compare_version() {
182 local INPUT_GIT_VERSION=$1;
183 local INSTALLED_GIT_VERSION
184diff --git a/lib/misc.zsh b/lib/misc.zsh
185index 0f7e7e9254959f01d6186c16f147764e9645e8b2..a8678b8ecd0185d66500e79bab39224676def2a6 100644
186--- a/lib/misc.zsh
187+++ b/lib/misc.zsh
188@@ -9,5 +9,7 @@ bindkey "^[m" copy-prev-shell-word
189 setopt long_list_jobs
190
191 ## pager
192-export PAGER="less -R"
193+export PAGER="less"
194+export LESS="-R"
195+
196 export LC_CTYPE=$LANG
197diff --git a/lib/rvm.zsh b/lib/rvm.zsh
198index 597be1b33b2076c267b202527909f6e896c099bd..e8744e61e373799201c3d55f4777f47be8728135 100644
199--- a/lib/rvm.zsh
200+++ b/lib/rvm.zsh
201@@ -1,7 +1,8 @@
202-# get the name of the branch we are on
203+# get the name of the ruby version
204 function rvm_prompt_info() {
205- ruby_version=$(~/.rvm/bin/rvm-prompt 2> /dev/null) || return
206- echo "($ruby_version)"
207+ [ -f $HOME/.rvm/bin/rvm-prompt ] || return
208+ local rvm_prompt
209+ rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
210+ [[ "${rvm_prompt}x" == "x" ]] && return
211+ echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
212 }
213-
214-
215diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
216index e26fef6d30d8a3f46e1fa4862c20626815743891..c056989eb5a49df87a69f343362f11adb545acfb 100644
217--- a/lib/termsupport.zsh
218+++ b/lib/termsupport.zsh
219@@ -26,8 +26,8 @@ function omz_termsupport_precmd {
220 function omz_termsupport_preexec {
221 emulate -L zsh
222 setopt extended_glob
223- local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
224- title "$CMD" "%100>...>$2%<<"
225+ local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
226+ title "$CMD" "%100>...>${2:gs/%/%%}%<<"
227 }
228
229 autoload -U add-zsh-hook
230diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
231index ddef1ad6cf280b2c4ce53af32a77f8e493bab7fc..689a79feffe989472c5b4aa76117a746f4e696c8 100644
232--- a/oh-my-zsh.sh
233+++ b/oh-my-zsh.sh
234@@ -11,7 +11,9 @@ fpath=($ZSH/functions $ZSH/completions $fpath)
235
236 # Load all of the config files in ~/oh-my-zsh that end in .zsh
237 # TIP: Add files you don't want in git to .gitignore
238-for config_file ($ZSH/lib/*.zsh) source $config_file
239+for config_file ($ZSH/lib/*.zsh); do
240+ source $config_file
241+done
242
243 # Set ZSH_CUSTOM to the path where your custom config files
244 # and plugins exists, or else we will use the default custom/
245@@ -51,7 +53,10 @@ for plugin ($plugins); do
246 done
247
248 # Load all of your custom configurations from custom/
249-for config_file ($ZSH_CUSTOM/*.zsh(N)) source $config_file
250+for config_file ($ZSH_CUSTOM/*.zsh(N)); do
251+ source $config_file
252+done
253+unset config_file
254
255 # Load the theme
256 if [ "$ZSH_THEME" = "random" ]
257diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
258index 294dc5354cce12627ab52e0d0d69f45ec9859131..ae92a0b4c5913ee7b7074f48b9cb283b5c437992 100644
259--- a/plugins/archlinux/archlinux.plugin.zsh
260+++ b/plugins/archlinux/archlinux.plugin.zsh
261@@ -11,7 +11,7 @@ if [[ -x `which yaourt` ]]; then
262 alias yaupg='yaourt -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system.
263 alias yasu='yaourt --sucre' # Same as yaupg, but without confirmation
264 alias yain='yaourt -S' # Install specific package(s) from the repositories
265- alias yains='yaourt -U' # Install specific package not from the repositories but from a file
266+ alias yains='yaourt -U' # Install specific package not from the repositories but from a file
267 alias yare='yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies
268 alias yarem='yaourt -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies
269 alias yarep='yaourt -Si' # Display information about a given package in the repositories
270@@ -35,7 +35,7 @@ fi
271 # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
272 alias pacupg='sudo pacman -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system.
273 alias pacin='sudo pacman -S' # Install specific package(s) from the repositories
274-alias pacins='sudo pacman -U' # Install specific package not from the repositories but from a file
275+alias pacins='sudo pacman -U' # Install specific package not from the repositories but from a file
276 alias pacre='sudo pacman -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies
277 alias pacrem='sudo pacman -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies
278 alias pacrep='pacman -Si' # Display information about a given package in the repositories
279@@ -75,3 +75,19 @@ pacdisowned() {
280
281 comm -23 "$fs" "$db"
282 }
283+
284+pacmanallkeys() {
285+ # Get all keys for developers and trusted users
286+ curl https://www.archlinux.org/{developers,trustedusers}/ |
287+ awk -F\" '(/pgp.mit.edu/) {sub(/.*search=0x/,"");print $1}' |
288+ xargs sudo pacman-key --recv-keys
289+}
290+
291+pacmansignkeys() {
292+ for key in $*; do
293+ sudo pacman-key --recv-keys $key
294+ sudo pacman-key --lsign-key $key
295+ printf 'trust\n3\n' | sudo gpg --homedir /etc/pacman.d/gnupg \
296+ --no-permission-warning --command-fd 0 --edit-key $key
297+ done
298+}
299diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh
300index 6f0edb062ac60bba4abc7b5fe84962ba286f8dee..3894ccd2f56c392f004327a5931b6b6a327b02b3 100644
301--- a/plugins/autojump/autojump.plugin.zsh
302+++ b/plugins/autojump/autojump.plugin.zsh
303@@ -3,7 +3,11 @@ if [ $commands[autojump] ]; then # check if autojump is installed
304 . /usr/share/autojump/autojump.zsh
305 elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
306 . /etc/profile.d/autojump.zsh
307- elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump ]; then # mac os x with brew
308- . `brew --prefix`/etc/autojump
309+ elif [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation
310+ . $HOME/.autojump/etc/profile.d/autojump.zsh
311+ elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports
312+ . /opt/local/etc/profile.d/autojump.zsh
313+ elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.zsh ]; then # mac os x with brew
314+ . `brew --prefix`/etc/autojump.zsh
315 fi
316 fi
317diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
318index bc75c5cf9ad01bd58ef29c4d83782ce5a849baff..95f8906321a948c4d0228c6ba0f580cd67556d73 100644
319--- a/plugins/battery/battery.plugin.zsh
320+++ b/plugins/battery/battery.plugin.zsh
321@@ -1,20 +1,71 @@
322-if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
323- function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" }
324- function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') }
325- function battery_pct_prompt() {
326- b=$(battery_pct_remaining)
327- if [ $b -gt 50 ] ; then
328- color='green'
329- elif [ $b -gt 20 ] ; then
330- color='yellow'
331+###########################################
332+# Battery plugin for oh-my-zsh #
333+# Original Author: Peter hoeg (peterhoeg) #
334+# Email: peter@speartail.com #
335+###########################################
336+# Author: Sean Jones (neuralsandwich) #
337+# Email: neuralsandwich@gmail.com #
338+# Modified to add support for Apple Mac #
339+###########################################
340+
341+if [[ $(uname) == "Darwin" ]] ; then
342+
343+ function battery_pct_remaining() {
344+ if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
345+ typeset -F maxcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"MaxCapacity"\ =\ ' | sed -e 's/^.*"MaxCapacity"\ =\ //')
346+ typeset -F currentcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"CurrentCapacity"\ =\ ' | sed -e 's/^.*CurrentCapacity"\ =\ //')
347+ integer i=$(((currentcapacity/maxcapacity) * 100))
348+ echo $i
349 else
350- color='red'
351+ echo "External Power"
352 fi
353- echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
354 }
355-else
356- error_msg='no battery'
357- function battery_pct_remaining() { echo $error_msg }
358- function battery_time_remaining() { echo $error_msg }
359- function battery_pct_prompt() { echo '' }
360+
361+ function battery_time_remaining() {
362+ if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
363+ timeremaining=$(ioreg -rc "AppleSmartBattery"| grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //')
364+ echo "~$((timeremaining / 60)):$((timeremaining % 60))"
365+ else
366+ echo "∞"
367+ fi
368+ }
369+
370+ function battery_pct_prompt () {
371+ if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
372+ b=$(battery_pct_remaining)
373+ if [ $b -gt 50 ] ; then
374+ color='green'
375+ elif [ $b -gt 20 ] ; then
376+ color='yellow'
377+ else
378+ color='red'
379+ fi
380+ echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
381+ else
382+ echo ""
383+ fi
384+ }
385+
386+elif [[ $(uname) == "Linux" ]] ; then
387+
388+ if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
389+ function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" }
390+ function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') }
391+ function battery_pct_prompt() {
392+ b=$(battery_pct_remaining)
393+ if [ $b -gt 50 ] ; then
394+ color='green'
395+ elif [ $b -gt 20 ] ; then
396+ color='yellow'
397+ else
398+ color='red'
399+ fi
400+ echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
401+ }
402+ else
403+ error_msg='no battery'
404+ function battery_pct_remaining() { echo $error_msg }
405+ function battery_time_remaining() { echo $error_msg }
406+ function battery_pct_prompt() { echo '' }
407+ fi
408 fi
409diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
410index 39b76ecdf9d8af6221430461b99c545bae2a804f..10c221acd5bcc38cac0caf8a8b2cacfe7fe9fd9f 100644
411--- a/plugins/bundler/bundler.plugin.zsh
412+++ b/plugins/bundler/bundler.plugin.zsh
413@@ -6,7 +6,7 @@ alias bu="bundle update"
414
415 # The following is based on https://github.com/gma/bundler-exec
416
417-bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails)
418+bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails puma zeus)
419
420 ## Functions
421
422@@ -33,6 +33,7 @@ _run-with-bundler() {
423
424 ## Main program
425 for cmd in $bundled_commands; do
426+ eval "function unbundled_$cmd () { $cmd \$@ }"
427 eval "function bundled_$cmd () { _run-with-bundler $cmd \$@}"
428 alias $cmd=bundled_$cmd
429
430diff --git a/plugins/bwana/bwana.plugin.zsh b/plugins/bwana/bwana.plugin.zsh
431new file mode 100644
432index 0000000000000000000000000000000000000000..455da862151d56f299dbd3923e09b28dc73895f0
433--- /dev/null
434+++ b/plugins/bwana/bwana.plugin.zsh
435@@ -0,0 +1,13 @@
436+#
437+# Requires http://www.bruji.com/bwana/
438+#
439+if [[ -e /Applications/Bwana.app ]] ||
440+ ( system_profiler -detailLevel mini SPApplicationsDataType | grep -q Bwana )
441+then
442+ function man() {
443+ open "man:$1"
444+ }
445+else
446+ echo "Bwana lets you read man files in Safari through a man: URI scheme"
447+ echo "To use it within Zsh, install it from http://www.bruji.com/bwana/"
448+fi
449diff --git a/plugins/cap/cap.plugin.zsh b/plugins/cap/cap.plugin.zsh
450deleted file mode 100644
451index 8336182d5d8692f609b04d0c9c9c385fc6de5367..0000000000000000000000000000000000000000
452--- a/plugins/cap/cap.plugin.zsh
453+++ /dev/null
454@@ -1,21 +0,0 @@
455-function _cap_does_task_list_need_generating () {
456- if [ ! -f .cap_tasks~ ]; then return 0;
457- else
458- accurate=$(stat -f%m .cap_tasks~)
459- changed=$(stat -f%m config/deploy.rb)
460- return $(expr $accurate '>=' $changed)
461- fi
462-}
463-
464-function _cap () {
465- if [ -f config/deploy.rb ]; then
466- if _cap_does_task_list_need_generating; then
467- echo "\nGenerating .cap_tasks~..." > /dev/stderr
468- cap show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D'
469-> .cap_tasks~
470- fi
471- compadd `cat .cap_tasks~`
472- fi
473-}
474-
475-compctl -K _cap cap
476diff --git a/plugins/capistrano/_capistrano b/plugins/capistrano/_capistrano
477new file mode 100644
478index 0000000000000000000000000000000000000000..cf6b50c7f9b62cd5d499352e5520cc43bcd9c2b5
479--- /dev/null
480+++ b/plugins/capistrano/_capistrano
481@@ -0,0 +1,10 @@
482+#compdef cap
483+#autoload
484+
485+if [ -f config/deploy.rb ]; then
486+ if [[ ! -f .cap_tasks~ || config/deploy.rb -nt .cap_tasks~ ]]; then
487+ echo "\nGenerating .cap_tasks~..." > /dev/stderr
488+ cap --tasks | grep '#' | cut -d " " -f 2 > .cap_tasks~
489+ fi
490+ compadd `cat .cap_tasks~`
491+fi
492diff --git a/plugins/coffee/_coffee b/plugins/coffee/_coffee
493new file mode 100644
494index 0000000000000000000000000000000000000000..5c8eb9a084050bf740c12992af8b609cb99a104c
495--- /dev/null
496+++ b/plugins/coffee/_coffee
497@@ -0,0 +1,71 @@
498+#compdef coffee
499+# ------------------------------------------------------------------------------
500+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
501+# All rights reserved.
502+#
503+# Redistribution and use in source and binary forms, with or without
504+# modification, are permitted provided that the following conditions are met:
505+# * Redistributions of source code must retain the above copyright
506+# notice, this list of conditions and the following disclaimer.
507+# * Redistributions in binary form must reproduce the above copyright
508+# notice, this list of conditions and the following disclaimer in the
509+# documentation and/or other materials provided with the distribution.
510+# * Neither the name of the zsh-users nor the
511+# names of its contributors may be used to endorse or promote products
512+# derived from this software without specific prior written permission.
513+#
514+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
515+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
516+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
517+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
518+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
519+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
520+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
521+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
522+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
523+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
524+# ------------------------------------------------------------------------------
525+# Description
526+# -----------
527+#
528+# Completion script for Coffee.js v0.6.11 (http://coffeejs.org)
529+#
530+# ------------------------------------------------------------------------------
531+# Authors
532+# -------
533+#
534+# * Mario Fernandez (https://github.com/sirech)
535+#
536+# ------------------------------------------------------------------------------
537+
538+local curcontext="$curcontext" state line ret=1
539+typeset -A opt_args
540+
541+_arguments -C \
542+ '(- *)'{-h,--help}'[display this help message]' \
543+ '(- *)'{-v,--version}'[display the version number]' \
544+ '(-b --bare)'{-b,--bare}'[compile without a top-level function wrapper]' \
545+ '(-e --eval)'{-e,--eval}'[pass a string from the command line as input]:Inline Script' \
546+ '(-i --interactive)'{-i,--interactive}'[run an interactive CoffeeScript REPL]' \
547+ '(-j --join)'{-j,--join}'[concatenate the source CoffeeScript before compiling]:Destination JS file:_files -g "*.js"' \
548+ '(-l --lint)'{-l,--lint}'[pipe the compiled JavaScript through JavaScript Lint]' \
549+ '(--nodejs)--nodejs[pass options directly to the "node" binary]' \
550+ '(-c --compile)'{-c,--compile}'[compile to JavaScript and save as .js files]' \
551+ '(-o --output)'{-o,--output}'[set the output directory for compiled JavaScript]:Output Directory:_files -/' \
552+ '(-n -t -p)'{-n,--nodes}'[print out the parse tree that the parser produces]' \
553+ '(-n -t -p)'{-p,--print}'[print out the compiled JavaScript]' \
554+ '(-n -t -p)'{-t,--tokens}'[print out the tokens that the lexer/rewriter produce]' \
555+ '(-r --require)'{-r,--require}'[require a library before executing your script]:library' \
556+ '(-s --stdio)'{-s,--stdio}'[listen for and compile scripts over stdio]' \
557+ '(-w --watch)'{-w,--watch}'[watch scripts for changes and rerun commands]' \
558+ '*:script or directory:_files' && ret=0
559+
560+return ret
561+
562+# Local Variables:
563+# mode: Shell-Script
564+# sh-indentation: 2
565+# indent-tabs-mode: nil
566+# sh-basic-offset: 2
567+# End:
568+# vim: ft=zsh sw=2 ts=2 et
569diff --git a/plugins/colemak/colemak-less b/plugins/colemak/colemak-less
570new file mode 100644
571index 0000000000000000000000000000000000000000..e4ca4facd65707c1f2ada112fb8781664439e637
572--- /dev/null
573+++ b/plugins/colemak/colemak-less
574@@ -0,0 +1,6 @@
575+n forw-line
576+e back-line
577+k repeat-search
578+\ek repeat-search-all
579+K reverse-search
580+\eK reverse-search-all
581diff --git a/plugins/colemak/colemak.plugin.zsh b/plugins/colemak/colemak.plugin.zsh
582new file mode 100644
583index 0000000000000000000000000000000000000000..34d42c280423836a39582089b504d240718a3f35
584--- /dev/null
585+++ b/plugins/colemak/colemak.plugin.zsh
586@@ -0,0 +1,22 @@
587+# ctrl-j newline
588+bindkey '^n' accept-line
589+bindkey -a '^n' accept-line
590+
591+# another rotation to match qwerty
592+bindkey -a 'n' down-line-or-history
593+bindkey -a 'e' up-line-or-history
594+bindkey -a 'i' vi-forward-char
595+
596+# make qwerty
597+bindkey -a 'k' vi-repeat-search
598+bindkey -a 'K' vi-rev-repeat-search
599+bindkey -a 'u' vi-insert
600+bindkey -a 'U' vi-insert-bol
601+bindkey -a 'l' vi-undo-change
602+bindkey -a 'N' vi-join
603+
604+# spare
605+bindkey -a 'j' vi-forward-word-end
606+bindkey -a 'J' vi-forward-blank-word-end
607+
608+lesskey $ZSH_CUSTOM/plugins/colemak/colemak-less
609diff --git a/plugins/command-not-found/command-not-found.plugin.zsh b/plugins/command-not-found/command-not-found.plugin.zsh
610index 5ab03d5a9a57c3ff3f46a9ae881e6bb1643becbd..567da1b450014b4db7b5445bf564973b76c1afea 100644
611--- a/plugins/command-not-found/command-not-found.plugin.zsh
612+++ b/plugins/command-not-found/command-not-found.plugin.zsh
613@@ -2,4 +2,4 @@
614 # as seen in http://www.porcheron.info/command-not-found-for-zsh/
615 # this is installed in Ubuntu
616
617-source /etc/zsh_command_not_found
618+[[ -e /etc/zsh_command_not_found ]] && source /etc/zsh_command_not_found
619diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh
620new file mode 100644
621index 0000000000000000000000000000000000000000..c9b762d072ab2a3a0c7df36f76f91c6bc624da6b
622--- /dev/null
623+++ b/plugins/composer/composer.plugin.zsh
624@@ -0,0 +1,29 @@
625+# ------------------------------------------------------------------------------
626+# FILE: composer.plugin.zsh
627+# DESCRIPTION: oh-my-zsh composer plugin file.
628+# AUTHOR: Daniel Gomes (me@danielcsgomes.com)
629+# VERSION: 1.0.0
630+# ------------------------------------------------------------------------------
631+
632+# Composer basic command completion
633+_composer_get_command_list () {
634+ composer --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }'
635+}
636+
637+_composer () {
638+ if [ -f composer.json ]; then
639+ compadd `_composer_get_command_list`
640+ fi
641+}
642+
643+compdef _composer composer
644+
645+# Aliases
646+alias c='composer'
647+alias csu='composer self-update'
648+alias cu='composer update'
649+alias ci='composer install'
650+alias ccp='composer create-project'
651+
652+# install composer in the current directory
653+alias cget='curl -s https://getcomposer.org/installer | php'
654diff --git a/plugins/cp/cp.plugin.zsh b/plugins/cp/cp.plugin.zsh
655new file mode 100644
656index 0000000000000000000000000000000000000000..7355a99902792ba5875256322da3997b3e348760
657--- /dev/null
658+++ b/plugins/cp/cp.plugin.zsh
659@@ -0,0 +1,14 @@
660+#Show progress while file is copying
661+
662+# Rsync options are:
663+# -p - preserve permissions
664+# -o - preserve owner
665+# -g - preserve group
666+# -h - output in human-readable format
667+# --progress - display progress
668+# -b - instead of just overwriting an existing file, save the original
669+# --backup-dir=/tmp/rsync - move backup copies to "/tmp/rsync"
670+# -e /dev/null - only work on local files
671+# -- - everything after this is an argument, even if it looks like an option
672+
673+alias cpv="rsync -poghb --backup-dir=/tmp/rsync -e /dev/null --progress --"
674diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh
675index 39d3ef36a05280e9e285412afecba861278bd73c..55b90e3793a3bc1f13cf43f7c1c0e74eb84062cc 100644
676--- a/plugins/debian/debian.plugin.zsh
677+++ b/plugins/debian/debian.plugin.zsh
678@@ -6,14 +6,14 @@
679
680 # Use aptitude if installed, or apt-get if not.
681 # You can just set apt_pref='apt-get' to override it.
682-if [[ -e $( which aptitude ) ]]; then
683+if [[ -e $( which aptitude 2>&1 ) ]]; then
684 apt_pref='aptitude'
685 else
686 apt_pref='apt-get'
687 fi
688
689 # Use sudo by default if it's installed
690-if [[ -e $( which sudo ) ]]; then
691+if [[ -e $( which sudo 2>&1 ) ]]; then
692 use_sudo=1
693 fi
694
695@@ -21,7 +21,7 @@ fi
696 # These are for more obscure uses of apt-get and aptitude that aren't covered
697 # below.
698 alias ag='apt-get'
699-alias at='aptitude'
700+alias ap='aptitude'
701
702 # Some self-explanatory aliases
703 alias acs="apt-cache search"
704@@ -35,7 +35,7 @@ alias afs='apt-file search --regexp'
705
706 # These are apt-get only
707 alias asrc='apt-get source'
708-alias ap='apt-cache policy'
709+alias app='apt-cache policy'
710
711 # superuser operations ######################################################
712 if [[ $use_sudo -eq 1 ]]; then
713@@ -61,7 +61,8 @@ if [[ $use_sudo -eq 1 ]]; then
714 # Install all .deb files in the current directory.
715 # Warning: you will need to put the glob in single quotes if you use:
716 # glob_subst
717- alias di='sudo dpkg -i ./*.deb'
718+ alias dia='sudo dpkg -i ./*.deb'
719+ alias di='sudo dpkg -i'
720
721 # Remove ALL kernel images and headers EXCEPT the one in use
722 alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \
723@@ -100,7 +101,8 @@ else
724
725 # Install all .deb files in the current directory
726 # Assumes glob_subst is off
727- alias di='su -lc "dpkg -i ./*.deb" root'
728+ alias dia='su -lc "dpkg -i ./*.deb" root'
729+ alias di='su -lc "dpkg -i" root'
730
731 # Remove ALL kernel images and headers EXCEPT the one in use
732 alias kclean='su -lc '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) \
733diff --git a/plugins/forklift/forklift.plugin.zsh b/plugins/forklift/forklift.plugin.zsh
734new file mode 100644
735index 0000000000000000000000000000000000000000..056069d36211daa345cf245105fbfe1ee104c993
736--- /dev/null
737+++ b/plugins/forklift/forklift.plugin.zsh
738@@ -0,0 +1,44 @@
739+# Open folder in ForkLift.app from console
740+# Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de
741+#
742+# Usage:
743+# fl [<folder>]
744+#
745+# Opens specified directory or current working directory in ForkLift.app
746+#
747+# Notes:
748+# It assumes Shift+Cmd+G launches go to folder panel and Cmd+N opens new
749+# app window.
750+#
751+# https://gist.github.com/3313481
752+function fl {
753+ if [ ! -z "$1" ]; then
754+ DIR=$1
755+ if [ ! -d "$DIR" ]; then
756+ DIR=$(dirname $DIR)
757+ fi
758+ if [ "$DIR" != "." ]; then
759+ PWD=`cd "$DIR";pwd`
760+ fi
761+ fi
762+ osascript 2>&1 1>/dev/null <<END
763+ tell application "ForkLift"
764+ activate
765+ end tell
766+ tell application "System Events"
767+ tell application process "ForkLift"
768+ try
769+ set topWindow to window 1
770+ on error
771+ keystroke "n" using command down
772+ set topWindow to window 1
773+ end try
774+ keystroke "g" using {command down, shift down}
775+ tell sheet 1 of topWindow
776+ set value of text field 1 to "$PWD"
777+ keystroke return
778+ end tell
779+ end tell
780+ end tell
781+END
782+}
783diff --git a/plugins/git-extras/git-extras.plugin.zsh b/plugins/git-extras/git-extras.plugin.zsh
784new file mode 100644
785index 0000000000000000000000000000000000000000..8419166abc10b7f05a30fe02d39aa34d3c33cddb
786--- /dev/null
787+++ b/plugins/git-extras/git-extras.plugin.zsh
788@@ -0,0 +1,285 @@
789+#compdef git
790+# ------------------------------------------------------------------------------
791+# Description
792+# -----------
793+#
794+# Completion script for git-extras (http://github.com/visionmedia/git-extras).
795+#
796+# ------------------------------------------------------------------------------
797+# Authors
798+# -------
799+#
800+# * Alexis GRIMALDI (https://github.com/agrimaldi)
801+#
802+# ------------------------------------------------------------------------------
803+# Inspirations
804+# -----------
805+#
806+# * git-extras (http://github.com/visionmedia/git-extras)
807+# * git-flow-completion (http://github.com/bobthecow/git-flow-completion)
808+#
809+# ------------------------------------------------------------------------------
810+
811+
812+__git_command_successful () {
813+ if (( ${#pipestatus:#0} > 0 )); then
814+ _message 'not a git repository'
815+ return 1
816+ fi
817+ return 0
818+}
819+
820+
821+__git_tag_names() {
822+ local expl
823+ declare -a tag_names
824+ tag_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/})
825+ __git_command_successful || return
826+ _wanted tag-names expl tag-name compadd $* - $tag_names
827+}
828+
829+
830+__git_branch_names() {
831+ local expl
832+ declare -a branch_names
833+ branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
834+ __git_command_successful || return
835+ _wanted branch-names expl branch-name compadd $* - $branch_names
836+}
837+
838+
839+__git_feature_branch_names() {
840+ local expl
841+ declare -a branch_names
842+ branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/feature 2>/dev/null)"}#refs/heads/feature/})
843+ __git_command_successful || return
844+ _wanted branch-names expl branch-name compadd $* - $branch_names
845+}
846+
847+
848+__git_refactor_branch_names() {
849+ local expl
850+ declare -a branch_names
851+ branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/refactor 2>/dev/null)"}#refs/heads/refactor/})
852+ __git_command_successful || return
853+ _wanted branch-names expl branch-name compadd $* - $branch_names
854+}
855+
856+
857+__git_bug_branch_names() {
858+ local expl
859+ declare -a branch_names
860+ branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/bug 2>/dev/null)"}#refs/heads/bug/})
861+ __git_command_successful || return
862+ _wanted branch-names expl branch-name compadd $* - $branch_names
863+}
864+
865+
866+__git_submodule_names() {
867+ local expl
868+ declare -a submodule_names
869+ submodule_names=(${(f)"$(_call_program branchrefs git submodule status | awk '{print $2}')"})
870+ __git_command_successful || return
871+ _wanted submodule-names expl submodule-name compadd $* - $submodule_names
872+}
873+
874+
875+__git_author_names() {
876+ local expl
877+ declare -a author_names
878+ author_names=(${(f)"$(_call_program branchrefs git log --format='%aN' | sort -u)"})
879+ __git_command_successful || return
880+ _wanted author-names expl author-name compadd $* - $author_names
881+}
882+
883+
884+_git-changelog() {
885+ _arguments \
886+ '(-l --list)'{-l,--list}'[list commits]' \
887+}
888diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh
889index 71b343884a5428660c92ce86ca63823d4337f8c7..ec21019e65c24ad21351dba73044952f687434e8 100644
890--- a/plugins/git-flow/git-flow.plugin.zsh
891+++ b/plugins/git-flow/git-flow.plugin.zsh
892@@ -195,7 +195,7 @@ __git-flow-feature ()
893 'start:Start a new feature branch.'
894 'finish:Finish a feature branch.'
895 'list:List all your feature branches. (Alias to `git flow feature`)'
896- 'publish: public'
897+ 'publish: publish'
898 'track: track'
899 'diff: diff'
900 'rebase: rebase'
901@@ -221,6 +221,7 @@ __git-flow-feature ()
902 _arguments \
903 -F'[Fetch from origin before performing finish]' \
904 -r'[Rebase instead of merge]'\
905+ -k'[Keep branch after performing finish]'\
906 ':feature:__git_flow_feature_list'
907 ;;
908
909@@ -236,13 +237,13 @@ __git-flow-feature ()
910
911 (diff)
912 _arguments \
913- ':branch:__git_branch_names'\
914+ ':branch:__git_flow_feature_list'\
915 ;;
916
917 (rebase)
918 _arguments \
919 -i'[Do an interactive rebase]' \
920- ':branch:__git_branch_names'
921+ ':branch:__git_flow_feature_list'
922 ;;
923
924 (checkout)
925@@ -253,7 +254,7 @@ __git-flow-feature ()
926 (pull)
927 _arguments \
928 ':remote:__git_remotes'\
929- ':branch:__git_branch_names'
930+ ':branch:__git_flow_feature_list'
931 ;;
932
933 *)
934@@ -333,4 +334,4 @@ __git_command_successful () {
935 return 0
936 }
937
938-zstyle ':completion:*:*:git:*' user-commands flow:'description for foo'
939+zstyle ':completion:*:*:git:*' user-commands flow:'description for foo'
940diff --git a/plugins/git-hubflow/git-hubflow.plugin.zsh b/plugins/git-hubflow/git-hubflow.plugin.zsh
941new file mode 100644
942index 0000000000000000000000000000000000000000..a09f88391778e6af32ab4329aa53542a90f2ae80
943--- /dev/null
944+++ b/plugins/git-hubflow/git-hubflow.plugin.zsh
945@@ -0,0 +1,348 @@
946+#!zsh
947+#
948+# Installation
949+# ------------
950+#
951+# To achieve git-hubflow completion nirvana:
952+#
953+# 0. Update your zsh's git-completion module to the newest verion.
954+# From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD
955+#
956+# 1. Install this file. Either:
957+#
958+# a. Place it in your .zshrc:
959+#
960+# b. Or, copy it somewhere (e.g. ~/.git-hubflow-completion.zsh) and put the following line in
961+# your .zshrc:
962+#
963+# source ~/.git-hubflow-completion.zsh
964+#
965+# c. Or, use this file as a oh-my-zsh plugin.
966+#
967+
968+_git-hf ()
969+{
970+ local curcontext="$curcontext" state line
971+ typeset -A opt_args
972+
973+ _arguments -C \
974+ ':command:->command' \
975+ '*::options:->options'
976+
977+ case $state in
978+ (command)
979+
980+ local -a subcommands
981+ subcommands=(
982+ 'init:Initialize a new git repo with support for the branching model.'
983+ 'feature:Manage your feature branches.'
984+ 'release:Manage your release branches.'
985+ 'hotfix:Manage your hotfix branches.'
986+ 'support:Manage your support branches.'
987+ 'update:Pull upstream changes down into your master and develop branches.'
988+ 'version:Shows version information.'
989+ )
990+ _describe -t commands 'git hf' subcommands
991+ ;;
992+
993+ (options)
994+ case $line[1] in
995+
996+ (init)
997+ _arguments \
998+ -f'[Force setting of gitflow branches, even if already configured]'
999+ ;;
1000+
1001+ (version)
1002+ ;;
1003+
1004+ (hotfix)
1005+ __git-hf-hotfix
1006+ ;;
1007+
1008+ (release)
1009+ __git-hf-release
1010+ ;;
1011+
1012+ (feature)
1013+ __git-hf-feature
1014+ ;;
1015+ esac
1016+ ;;
1017+ esac
1018+}
1019+
1020+__git-hf-release ()
1021+{
1022+ local curcontext="$curcontext" state line
1023+ typeset -A opt_args
1024+
1025+ _arguments -C \
1026+ ':command:->command' \
1027+ '*::options:->options'
1028+
1029+ case $state in
1030+ (command)
1031+
1032+ local -a subcommands
1033+ subcommands=(
1034+ 'start:Start a new release branch.'
1035+ 'finish:Finish a release branch.'
1036+ 'list:List all your release branches. (Alias to `git hf release`)'
1037+ 'cancel:Cancel release'
1038+ 'push:Push release to github'
1039+ 'pull:Pull release from github'
1040+ 'track:Track release'
1041+ )
1042+ _describe -t commands 'git hf release' subcommands
1043+ _arguments \
1044+ -v'[Verbose (more) output]'
1045diff --git a/plugins/git-remote-branch/git-remote-branch.plugin.zsh b/plugins/git-remote-branch/git-remote-branch.plugin.zsh
1046new file mode 100644
1047index 0000000000000000000000000000000000000000..ff98cbf87a296045abbff56082dfeae839f79dbf
1048--- /dev/null
1049+++ b/plugins/git-remote-branch/git-remote-branch.plugin.zsh
1050@@ -0,0 +1,18 @@
1051+_git_remote_branch() {
1052+ ref=$(git symbolic-ref HEAD 2> /dev/null)
1053+ if [[ -n $ref ]]; then
1054+ if (( CURRENT == 2 )); then
1055+ # first arg: operation
1056+ compadd create publish rename delete track
1057+ elif (( CURRENT == 3 )); then
1058+ # second arg: remote branch name
1059+ compadd `git branch -r | grep -v HEAD | sed "s/.*\///" | sed "s/ //g"`
1060+ elif (( CURRENT == 4 )); then
1061+ # third arg: remote name
1062+ compadd `git remote`
1063+ fi
1064+ else;
1065+ _files
1066+ fi
1067+}
1068+compdef _git_remote_branch grb
1069diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
1070index d3d3f702a362c6ebe24109369da2e6d1a8652464..154aa6db1a4d686c65be2c4931c40eaac4d6bd8d 100644
1071--- a/plugins/git/git.plugin.zsh
1072+++ b/plugins/git/git.plugin.zsh
1073@@ -5,10 +5,11 @@ alias gst='git status'
1074 compdef _git gst=git-status
1075 alias gl='git pull'
1076 compdef _git gl=git-pull
1077-alias gup='git fetch && git rebase'
1078+alias gup='git pull --rebase'
1079 compdef _git gup=git-fetch
1080 alias gp='git push'
1081 compdef _git gp=git-push
1082+alias gd='git diff'
1083 gdv() { git diff -w "$@" | view - }
1084 compdef _git gdv=git-diff
1085 alias gc='git commit -v'
1086@@ -18,18 +19,33 @@ compdef _git gca=git-commit
1087 alias gco='git checkout'
1088 compdef _git gco=git-checkout
1089 alias gcm='git checkout master'
1090+alias gr='git remote'
1091+compdef _git gr=git-remote
1092+alias grv='git remote -v'
1093+compdef _git grv=git-remote
1094+alias grmv='git remote rename'
1095+compdef _git grmv=git-remote
1096+alias grrm='git remote remove'
1097+compdef _git grrm=git-remote
1098+alias grset='git remote set-url'
1099+compdef _git grset=git-remote
1100+alias grup='git remote update'
1101+compdef _git grset=git-remote
1102 alias gb='git branch'
1103 compdef _git gb=git-branch
1104 alias gba='git branch -a'
1105 compdef _git gba=git-branch
1106 alias gcount='git shortlog -sn'
1107 compdef gcount=git
1108+alias gcl='git config --list'
1109 alias gcp='git cherry-pick'
1110 compdef _git gcp=git-cherry-pick
1111 alias glg='git log --stat --max-count=5'
1112 compdef _git glg=git-log
1113 alias glgg='git log --graph --max-count=5'
1114 compdef _git glgg=git-log
1115+alias glgga='git log --graph --decorate --all'
1116+compdef _git glgga=git-log
1117 alias gss='git status -s'
1118 compdef _git gss=git-status
1119 alias ga='git add'
1120@@ -38,6 +54,13 @@ alias gm='git merge'
1121 compdef _git gm=git-merge
1122 alias grh='git reset HEAD'
1123 alias grhh='git reset HEAD --hard'
1124+alias gwc='git whatchanged -p --abbrev-commit --pretty=medium'
1125+alias gf='git ls-files | grep'
1126+alias gpoat='git push origin --all && git push origin --tags'
1127+
1128+# Will cd into the top of the current repository
1129+# or submodule.
1130+alias grt='cd $(git rev-parse --show-toplevel || echo ".")'
1131
1132 # Git and svn mix
1133 alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
1134@@ -50,13 +73,14 @@ alias gsd='git svn dcommit'
1135 # Usage example: git pull origin $(current_branch)
1136 #
1137 function current_branch() {
1138- ref=$(git symbolic-ref HEAD 2> /dev/null) || return
1139+ ref=$(git symbolic-ref HEAD 2> /dev/null) || \
1140+ ref=$(git rev-parse --short HEAD 2> /dev/null) || return
1141 echo ${ref#refs/heads/}
1142 }
1143
1144 function current_repository() {
1145-
1146- ref=$(git symbolic-ref HEAD 2> /dev/null) || return
1147+ ref=$(git symbolic-ref HEAD 2> /dev/null) || \
1148+ ref=$(git rev-parse --short HEAD 2> /dev/null) || return
1149 echo $(git remote -v | cut -d':' -f 2)
1150 }
1151
1152diff --git a/plugins/gitfast/_git b/plugins/gitfast/_git
1153new file mode 100644
1154index 0000000000000000000000000000000000000000..45775021fff11011a98b90a6b8ebaa72d3d0cd9f
1155--- /dev/null
1156+++ b/plugins/gitfast/_git
1157@@ -0,0 +1,78 @@
1158+#compdef git gitk
1159+
1160+# zsh completion wrapper for git
1161+#
1162+# You need git's bash completion script installed somewhere, by default on the
1163+# same directory as this script.
1164+#
1165+# If your script is on ~/.git-completion.sh instead, you can configure it on
1166+# your ~/.zshrc:
1167+#
1168+# zstyle ':completion:*:*:git:*' script ~/.git-completion.sh
1169+#
1170+# The recommended way to install this script is to copy to
1171+# '~/.zsh/completion/_git', and then add the following to your ~/.zshrc file:
1172+#
1173+# fpath=(~/.zsh/completion $fpath)
1174+
1175+complete ()
1176+{
1177+ # do nothing
1178+ return 0
1179+}
1180+
1181+zstyle -s ":completion:*:*:git:*" script script
1182+test -z "$script" && script="$(dirname ${funcsourcetrace[1]%:*})"/git-completion.bash
1183+ZSH_VERSION='' . "$script"
1184+
1185+__gitcomp ()
1186+{
1187+ emulate -L zsh
1188+
1189+ local cur_="${3-$cur}"
1190+
1191+ case "$cur_" in
1192+ --*=)
1193+ ;;
1194+ *)
1195+ local c IFS=$' \t\n'
1196+ local -a array
1197+ for c in ${=1}; do
1198+ c="$c${4-}"
1199+ case $c in
1200+ --*=*|*.) ;;
1201+ *) c="$c " ;;
1202+ esac
1203+ array+=("$c")
1204+ done
1205+ compset -P '*[=:]'
1206+ compadd -Q -S '' -p "${2-}" -a -- array && _ret=0
1207+ ;;
1208+ esac
1209+}
1210+
1211+__gitcomp_nl ()
1212+{
1213+ emulate -L zsh
1214+
1215+ local IFS=$'\n'
1216+ compset -P '*[=:]'
1217+ compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0
1218+}
1219+
1220+_git ()
1221+{
1222+ local _ret=1
1223+ () {
1224+ emulate -L ksh
1225+ local cur cword prev
1226+ cur=${words[CURRENT-1]}
1227+ prev=${words[CURRENT-2]}
1228+ let cword=CURRENT-1
1229+ __${service}_main
1230+ }
1231+ let _ret && _default -S '' && _ret=0
1232+ return _ret
1233+}
1234+
1235+_git
1236diff --git a/plugins/gitfast/git-completion.bash b/plugins/gitfast/git-completion.bash
1237new file mode 100644
1238index 0000000000000000000000000000000000000000..be800e09bdf0656951c415105e0d32ce0b0edf9e
1239--- /dev/null
1240+++ b/plugins/gitfast/git-completion.bash
1241@@ -0,0 +1,2483 @@
1242+#!bash
1243+#
1244+# bash/zsh completion support for core Git.
1245+#
1246+# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
1247+# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
1248+# Distributed under the GNU General Public License, version 2.0.
1249+#
1250+# The contained completion routines provide support for completing:
1251+#
1252+# *) local and remote branch names
1253+# *) local and remote tag names
1254+# *) .git/remotes file names
1255+# *) git 'subcommands'
1256+# *) tree paths within 'ref:path/to/file' expressions
1257+# *) common --long-options
1258+#
1259+# To use these routines:
1260+#
1261+# 1) Copy this file to somewhere (e.g. ~/.git-completion.sh).
1262+# 2) Add the following line to your .bashrc/.zshrc:
1263+# source ~/.git-completion.sh
1264+# 3) Consider changing your PS1 to also show the current branch,
1265+# see git-prompt.sh for details.
1266+
1267+if [[ -n ${ZSH_VERSION-} ]]; then
1268+ autoload -U +X bashcompinit && bashcompinit
1269+fi
1270+
1271+case "$COMP_WORDBREAKS" in
1272+*:*) : great ;;
1273+*) COMP_WORDBREAKS="$COMP_WORDBREAKS:"
1274+esac
1275+
1276+# __gitdir accepts 0 or 1 arguments (i.e., location)
1277+# returns location of .git repo
1278+__gitdir ()
1279+{
1280+ # Note: this function is duplicated in git-prompt.sh
1281+ # When updating it, make sure you update the other one to match.
1282+ if [ -z "${1-}" ]; then
1283+ if [ -n "${__git_dir-}" ]; then
1284+ echo "$__git_dir"
1285+ elif [ -n "${GIT_DIR-}" ]; then
1286+ test -d "${GIT_DIR-}" || return 1
1287+ echo "$GIT_DIR"
1288+ elif [ -d .git ]; then
1289+ echo .git
1290+ else
1291+ git rev-parse --git-dir 2>/dev/null
1292+ fi
1293+ elif [ -d "$1/.git" ]; then
1294+ echo "$1/.git"
1295+ else
1296+ echo "$1"
1297+ fi
1298+}
1299+
1300+__gitcomp_1 ()
1301+{
1302+ local c IFS=$' \t\n'
1303+ for c in $1; do
1304+ c="$c$2"
1305+ case $c in
1306+ --*=*|*.) ;;
1307+ *) c="$c " ;;
1308+ esac
1309+ printf '%s\n' "$c"
1310+ done
1311+}
1312+
1313+# The following function is based on code from:
1314+#
1315+# bash_completion - programmable completion functions for bash 3.2+
1316+#
1317+# Copyright © 2006-2008, Ian Macdonald <ian@caliban.org>
1318+# © 2009-2010, Bash Completion Maintainers
1319+# <bash-completion-devel@lists.alioth.debian.org>
1320+#
1321+# This program is free software; you can redistribute it and/or modify
1322+# it under the terms of the GNU General Public License as published by
1323+# the Free Software Foundation; either version 2, or (at your option)
1324+# any later version.
1325+#
1326+# This program is distributed in the hope that it will be useful,
1327+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1328+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1329+# GNU General Public License for more details.
1330+#
1331+# You should have received a copy of the GNU General Public License
1332+# along with this program; if not, write to the Free Software Foundation,
1333+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1334+#
1335+# The latest version of this software can be obtained here:
1336+#
1337+# http://bash-completion.alioth.debian.org/
1338+#
1339+# RELEASE: 2.x
1340+
1341diff --git a/plugins/gitfast/git-prompt.sh b/plugins/gitfast/git-prompt.sh
1342new file mode 100644
1343index 0000000000000000000000000000000000000000..bf20491ec33e467f6b9591d94a2e27bc9e3d93e9
1344--- /dev/null
1345+++ b/plugins/gitfast/git-prompt.sh
1346@@ -0,0 +1,290 @@
1347+# bash/zsh git prompt support
1348+#
1349+# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
1350+# Distributed under the GNU General Public License, version 2.0.
1351+#
1352+# This script allows you to see the current branch in your prompt.
1353+#
1354+# To enable:
1355+#
1356+# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).
1357+# 2) Add the following line to your .bashrc/.zshrc:
1358+# source ~/.git-prompt.sh
1359+# 3) Change your PS1 to also show the current branch:
1360+# Bash: PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
1361+# ZSH: PS1='[%n@%m %c$(__git_ps1 " (%s)")]\$ '
1362+#
1363+# The argument to __git_ps1 will be displayed only if you are currently
1364+# in a git repository. The %s token will be the name of the current
1365+# branch.
1366+#
1367+# In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty value,
1368+# unstaged (*) and staged (+) changes will be shown next to the branch
1369+# name. You can configure this per-repository with the
1370+# bash.showDirtyState variable, which defaults to true once
1371+# GIT_PS1_SHOWDIRTYSTATE is enabled.
1372+#
1373+# You can also see if currently something is stashed, by setting
1374+# GIT_PS1_SHOWSTASHSTATE to a nonempty value. If something is stashed,
1375+# then a '$' will be shown next to the branch name.
1376+#
1377+# If you would like to see if there're untracked files, then you can set
1378+# GIT_PS1_SHOWUNTRACKEDFILES to a nonempty value. If there're untracked
1379+# files, then a '%' will be shown next to the branch name.
1380+#
1381+# If you would like to see the difference between HEAD and its upstream,
1382+# set GIT_PS1_SHOWUPSTREAM="auto". A "<" indicates you are behind, ">"
1383+# indicates you are ahead, "<>" indicates you have diverged and "="
1384+# indicates that there is no difference. You can further control
1385+# behaviour by setting GIT_PS1_SHOWUPSTREAM to a space-separated list
1386+# of values:
1387+#
1388+# verbose show number of commits ahead/behind (+/-) upstream
1389+# legacy don't use the '--count' option available in recent
1390+# versions of git-rev-list
1391+# git always compare HEAD to @{upstream}
1392+# svn always compare HEAD to your SVN upstream
1393+#
1394+# By default, __git_ps1 will compare HEAD to your SVN upstream if it can
1395+# find one, or @{upstream} otherwise. Once you have set
1396+# GIT_PS1_SHOWUPSTREAM, you can override it on a per-repository basis by
1397+# setting the bash.showUpstream config variable.
1398+
1399+# __gitdir accepts 0 or 1 arguments (i.e., location)
1400+# returns location of .git repo
1401+__gitdir ()
1402+{
1403+ # Note: this function is duplicated in git-completion.bash
1404+ # When updating it, make sure you update the other one to match.
1405+ if [ -z "${1-}" ]; then
1406+ if [ -n "${__git_dir-}" ]; then
1407+ echo "$__git_dir"
1408+ elif [ -n "${GIT_DIR-}" ]; then
1409+ test -d "${GIT_DIR-}" || return 1
1410+ echo "$GIT_DIR"
1411+ elif [ -d .git ]; then
1412+ echo .git
1413+ else
1414+ git rev-parse --git-dir 2>/dev/null
1415+ fi
1416+ elif [ -d "$1/.git" ]; then
1417+ echo "$1/.git"
1418+ else
1419+ echo "$1"
1420+ fi
1421+}
1422+
1423+# stores the divergence from upstream in $p
1424+# used by GIT_PS1_SHOWUPSTREAM
1425+__git_ps1_show_upstream ()
1426+{
1427+ local key value
1428+ local svn_remote svn_url_pattern count n
1429+ local upstream=git legacy="" verbose=""
1430+
1431+ svn_remote=()
1432+ # get some config options from git-config
1433+ local output="$(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')"
1434+ while read -r key value; do
1435+ case "$key" in
1436+ bash.showupstream)
1437+ GIT_PS1_SHOWUPSTREAM="$value"
1438+ if [[ -z "${GIT_PS1_SHOWUPSTREAM}" ]]; then
1439+ p=""
1440+ return
1441+ fi
1442+ ;;
1443+ svn-remote.*.url)
1444+ svn_remote[ $((${#svn_remote[@]} + 1)) ]="$value"
1445+ svn_url_pattern+="\\|$value"
1446diff --git a/plugins/gitfast/gitfast.plugin.zsh b/plugins/gitfast/gitfast.plugin.zsh
1447new file mode 100644
1448index 0000000000000000000000000000000000000000..7e50cf721cb33e5f090379cb43b2c53950a17902
1449--- /dev/null
1450+++ b/plugins/gitfast/gitfast.plugin.zsh
1451@@ -0,0 +1,7 @@
1452+dir=$(dirname $0)
1453+source $dir/../git/git.plugin.zsh
1454+source $dir/git-prompt.sh
1455+
1456+function git_prompt_info() {
1457+ __git_ps1 "${ZSH_THEME_GIT_PROMPT_PREFIX//\%/%%}%s${ZSH_THEME_GIT_PROMPT_SUFFIX//\%/%%}"
1458+}
1459diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh
1460index 197e86a48743419f79cceb8f4d4ebdafca0a5972..598b059c18753f0f76002a2e93046f037c1c9e56 100644
1461--- a/plugins/github/github.plugin.zsh
1462+++ b/plugins/github/github.plugin.zsh
1463@@ -61,6 +61,7 @@ exist_gh() { # [DIRECTORY]
1464 cd "$1"
1465 name=$( git config user.name )
1466 ghuser=$( git config github.user )
1467+ repo=$1
1468
1469 git remote add origin git@github.com:${ghuser}/${repo}.git
1470 git push -u origin master
1471diff --git a/plugins/heroku/_heroku b/plugins/heroku/_heroku
1472index dc899e2b2a3e07b6d36501b4b1b6f4f6211302db..a95c38647f9bde735428d46db379f331fcf62113 100644
1473--- a/plugins/heroku/_heroku
1474+++ b/plugins/heroku/_heroku
1475@@ -154,5 +154,6 @@ case "$words[1]" in
1476 _arguments \
1477 $_command_args \
1478 '(--app)--app[the app name]' \
1479+ '(--remote)--remote[the remote name]' \
1480 && return 0
1481
1482diff --git a/plugins/history/history.plugin.zsh b/plugins/history/history.plugin.zsh
1483new file mode 100644
1484index 0000000000000000000000000000000000000000..0f4aa4b10720d359d48cbac77c86234bf26f56a3
1485--- /dev/null
1486+++ b/plugins/history/history.plugin.zsh
1487@@ -0,0 +1,8 @@
1488+alias h='history'
1489+
1490+function hs
1491+{
1492+ history | grep $*
1493+}
1494+
1495+alias hsi='hs -i'
1496diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh
1497new file mode 100644
1498index 0000000000000000000000000000000000000000..b91f93c9565620f53094880cef5bc0469ab3250f
1499--- /dev/null
1500+++ b/plugins/jira/jira.plugin.zsh
1501@@ -0,0 +1,38 @@
1502+# To use: add a .jira-url file in the base of your project
1503+# You can also set JIRA_URL in your .zshrc or put .jira-url in your home directory
1504+# .jira-url in the current directory takes precedence
1505+#
1506+# If you use Rapid Board, set:
1507+#JIRA_RAPID_BOARD="yes"
1508+# in you .zshrc
1509+#
1510+# Setup: cd to/my/project
1511+# echo "https://name.jira.com" >> .jira-url
1512+# Usage: jira # opens a new issue
1513+# jira ABC-123 # Opens an existing issue
1514+open_jira_issue () {
1515+ if [ -f .jira-url ]; then
1516+ jira_url=$(cat .jira-url)
1517+ elif [ -f ~/.jira-url ]; then
1518+ jira_url=$(cat ~/.jira-url)
1519+ elif [[ "x$JIRA_URL" != "x" ]]; then
1520+ jira_url=$JIRA_URL
1521+ else
1522+ echo "JIRA url is not specified anywhere."
1523+ return 0
1524+ fi
1525+
1526+ if [ -z "$1" ]; then
1527+ echo "Opening new issue"
1528+ `open $jira_url/secure/CreateIssue!default.jspa`
1529+ else
1530+ echo "Opening issue #$1"
1531+ if [[ "x$JIRA_RAPID_BOARD" = "yes" ]]; then
1532+ `open $jira_url/issues/$1`
1533+ else
1534+ `open $jira_url/browse/$1`
1535+ fi
1536+ fi
1537+}
1538+
1539+alias jira='open_jira_issue'
1540diff --git a/plugins/knife/_knife b/plugins/knife/_knife
1541index 8453af5be60abb5412a28010dc500f7fb1512cc9..dec49125786e5dd40b04d092f540cc07e2ce57b3 100644
1542--- a/plugins/knife/_knife
1543+++ b/plugins/knife/_knife
1544@@ -170,7 +170,11 @@ _chef_environments_remote() {
1545
1546 # The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server
1547 _chef_cookbooks_local() {
1548- (for i in $( grep cookbook_path $HOME/.chef/knife.rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' ); do ls $i; done)
1549+ local knife_rb="$HOME/.chef/knife.rb"
1550+ if [ -f ./.chef/knife.rb ]; then
1551+ knife_rb="./.chef/knife.rb"
1552+ fi
1553+ (for i in $( grep cookbook_path $knife_rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' ); do ls $i; done)
1554 }
1555
1556 # This function extracts the available cookbook versions on the chef server
1557diff --git a/plugins/laravel/_artisan b/plugins/laravel/_artisan
1558new file mode 100644
1559index 0000000000000000000000000000000000000000..8637514cfe97ccf0ce40d208b46c68ebbb8f86bb
1560--- /dev/null
1561+++ b/plugins/laravel/_artisan
1562@@ -0,0 +1,40 @@
1563+#compdef artisan
1564+
1565+# Laravel autocompletion
1566+# Author: John Hamelink <john@johnhamelink.com>
1567+#
1568+# This plugin does the following:
1569+# - Adds aliases and autocompletion for artisan
1570+# - Adds aliases and autocompletion for bob
1571+
1572+local curcontext="$curcontext" state line _opts _bundles ret=1
1573+_arguments -C \
1574+ '1: :->cmds' \
1575+ '*:: :->args' && ret=0
1576+
1577+case $state in
1578+ cmds)
1579+
1580+ _values "Artisan command" \
1581+ 'session\:install[Create a session table]' \
1582+ 'migrate[Manage Migrations]' \
1583+ 'test[Run a test]' \
1584+ 'route\:\:call[Call a route in the CLI]' \
1585+ 'key\:\:generate[Generate a key]'
1586+ ret=0
1587+ ;;
1588+ args)
1589+ case $line[1] in
1590+ migrate)
1591+ _values \
1592+ 'install[Create the Laravel migration table' \
1593+ 'make[Create a migration]' \
1594+ 'rollback[Roll back to the last migration operation]' \
1595+ 'reset[Roll back all migrations that have ever run]'
1596+ ret=0
1597+ ;;
1598+ esac
1599+ ;;
1600+esac
1601+
1602+return ret
1603diff --git a/plugins/laravel/laravel.plugin.zsh b/plugins/laravel/laravel.plugin.zsh
1604new file mode 100644
1605index 0000000000000000000000000000000000000000..ed932ee89fae5965f74bdad6cd65a18cfa696640
1606--- /dev/null
1607+++ b/plugins/laravel/laravel.plugin.zsh
1608@@ -0,0 +1,3 @@
1609+#!zsh
1610+alias artisan='php artisan'
1611+alias bob='php artisan bob::build'
1612diff --git a/plugins/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh
1613new file mode 100644
1614index 0000000000000000000000000000000000000000..190bc279d505cc9c985023f10a12ee694dbd3067
1615--- /dev/null
1616+++ b/plugins/last-working-dir/last-working-dir.plugin.zsh
1617@@ -0,0 +1,24 @@
1618+#!/usr/bin/env zsh
1619+# Keeps track of the last used working directory and automatically jumps
1620+# into it for new shells.
1621+
1622+# Flag indicating if we've previously jumped to last directory.
1623+typeset -g ZSH_LAST_WORKING_DIRECTORY
1624+mkdir -p "$ZSH/cache"
1625+local cache_file="$ZSH/cache/last-working-dir"
1626+
1627+# Updates the last directory once directory is changed.
1628+function chpwd() {
1629+ echo "$PWD" > "$cache_file"
1630+}
1631+
1632+# Changes directory to the last working directory.
1633+function lwd() {
1634+ [[ ! -r "$cache_file" ]] || cd `cat "$cache_file"`
1635+}
1636+
1637+# Automatically jump to last working directory unless this isn't the first time
1638+# this plugin has been loaded.
1639+if [[ -z "$ZSH_LAST_WORKING_DIRECTORY" ]]; then
1640+ lwd 2>/dev/null && ZSH_LAST_WORKING_DIRECTORY=1 || true
1641+fi
1642diff --git a/plugins/lol/lol.plugin.zsh b/plugins/lol/lol.plugin.zsh
1643index 697f98d664f92b71ab9bed127cda0e42e5726d7c..ae065c12f8066f2197af9f24b879c0101e519cb5 100644
1644--- a/plugins/lol/lol.plugin.zsh
1645+++ b/plugins/lol/lol.plugin.zsh
1646@@ -5,6 +5,7 @@ alias wtf='dmesg'
1647 alias onoz='cat /var/log/errors.log'
1648 alias rtfm='man'
1649
1650+alias :3='echo'
1651 alias visible='echo'
1652 alias invisible='cat'
1653 alias moar='more'
1654diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh
1655index caf0d9efc81196a73e9b8592fd3a0a3b0f46ed17..a3a6ff8b65e42b49b9e59e5cb56c8b49f9563456 100644
1656--- a/plugins/mercurial/mercurial.plugin.zsh
1657+++ b/plugins/mercurial/mercurial.plugin.zsh
1658@@ -12,3 +12,9 @@ alias hgp='hg push'
1659 alias hgs='hg status'
1660 # this is the 'git commit --amend' equivalent
1661 alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'
1662+
1663+function hg_current_branch() {
1664+ if [ -d .hg ]; then
1665+ echo hg:$(hg branch)
1666+ fi
1667+}
1668diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
1669index e8af2f49d5d2f87daeae99b23d59fecdc7b44d26..da29b4f0abaf50ffa5c315d1ebcfdf032a21b0ae 100644
1670--- a/plugins/mvn/mvn.plugin.zsh
1671+++ b/plugins/mvn/mvn.plugin.zsh
1672@@ -1,6 +1,170 @@
1673+# mvn-color based on https://gist.github.com/1027800
1674+export BOLD=`tput bold`
1675+export UNDERLINE_ON=`tput smul`
1676+export UNDERLINE_OFF=`tput rmul`
1677+export TEXT_BLACK=`tput setaf 0`
1678+export TEXT_RED=`tput setaf 1`
1679+export TEXT_GREEN=`tput setaf 2`
1680+export TEXT_YELLOW=`tput setaf 3`
1681+export TEXT_BLUE=`tput setaf 4`
1682+export TEXT_MAGENTA=`tput setaf 5`
1683+export TEXT_CYAN=`tput setaf 6`
1684+export TEXT_WHITE=`tput setaf 7`
1685+export BACKGROUND_BLACK=`tput setab 0`
1686+export BACKGROUND_RED=`tput setab 1`
1687+export BACKGROUND_GREEN=`tput setab 2`
1688+export BACKGROUND_YELLOW=`tput setab 3`
1689+export BACKGROUND_BLUE=`tput setab 4`
1690+export BACKGROUND_MAGENTA=`tput setab 5`
1691+export BACKGROUND_CYAN=`tput setab 6`
1692+export BACKGROUND_WHITE=`tput setab 7`
1693+export RESET_FORMATTING=`tput sgr0`
1694+
1695+
1696+# Wrapper function for Maven's mvn command.
1697+mvn-color()
1698+{
1699+ # Filter mvn output using sed
1700+ mvn $@ | sed -e "s/\(\[INFO\]\ \-.*\)/${TEXT_BLUE}${BOLD}\1/g" \
1701+ -e "s/\(\[INFO\]\ \[.*\)/${RESET_FORMATTING}${BOLD}\1${RESET_FORMATTING}/g" \
1702+ -e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \
1703+ -e "s/\(\[WARNING\].*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}/g" \
1704+ -e "s/\(\[ERROR\].*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}/g" \
1705diff --git a/plugins/nanoc/_nanoc b/plugins/nanoc/_nanoc
1706new file mode 100644
1707index 0000000000000000000000000000000000000000..fde07c3fccc5c8faae39916f8a7dd9e5edc43afe
1708--- /dev/null
1709+++ b/plugins/nanoc/_nanoc
1710@@ -0,0 +1,44 @@
1711+#compdef nanoc
1712+#autoload
1713+
1714+# nanoc zsh completion - based on the homebrew zsh completion
1715+# requires the 'nanoc' gem to be installed
1716+
1717+local -a _1st_arguments
1718+_1st_arguments=(
1719+ 'autocompile:start the autocompiler'
1720+ 'compile:compile items of this site'
1721+ 'create-item:create an item'
1722+ 'create-layout:create a layout'
1723+ 'create-site:create a site'
1724+ 'deploy:deploy the compiled site'
1725+ 'help:show help'
1726+ 'prune:remove files not managed by nanoc from the output directory'
1727+ 'show-data:show data in this site'
1728+ 'show-plugins:show all available plugins'
1729+ 'show-rules:describe the rules for each item'
1730+ 'update:update the data stored by the data source to a newer version'
1731+ 'validate-css:validate the site’s CSS'
1732+ 'validate-html:validate the site’s HTML'
1733+ 'validate-links:validate links in site'
1734+ 'view:start the web server that serves static files'
1735+ 'watch:start the watcher'
1736+)
1737+
1738+local expl
1739+local -a pkgs installed_pkgs
1740+
1741+_arguments \
1742+ '(--color)--color[enable color]' \
1743+ '(--debug)--debug[enable debugging]' \
1744+ '(--help)--help[show the help message and quit]' \
1745+ '(--no-color)--no-color[disable color]' \
1746+ '(--verbose)--verbose[make nanoc output more detailed]' \
1747+ '(--version)--version[show version information and quit]' \
1748+ '(--warn)--warn[enable warnings]' \
1749+ '*:: :->subcmds' && return 0
1750+
1751+if (( CURRENT == 1 )); then
1752+ _describe -t commands "nanoc subcommand" _1st_arguments
1753+ return
1754+fi
1755diff --git a/plugins/nanoc/nanoc.plugin.zsh b/plugins/nanoc/nanoc.plugin.zsh
1756new file mode 100644
1757index 0000000000000000000000000000000000000000..5a5064613a999f01d98fea4ccc9f7a384e80460f
1758--- /dev/null
1759+++ b/plugins/nanoc/nanoc.plugin.zsh
1760@@ -0,0 +1,9 @@
1761+alias n='nanoc'
1762+alias na='nanoc autocompile'
1763+alias nco='nanoc compile'
1764+alias nci='nanoc create_item'
1765+alias ncl='nanoc create_layout'
1766+alias ncs='nanoc create_site'
1767+alias nd='nanoc deploy'
1768+alias nv='nanoc view'
1769+alias nw='nanoc watch'
1770diff --git a/plugins/node/node.plugin.zsh b/plugins/node/node.plugin.zsh
1771index 519bc18da425f86f2a5fd433cad5075d79a1075a..3bbed6f04c5a165465b63b7c64f24153585645f5 100644
1772--- a/plugins/node/node.plugin.zsh
1773+++ b/plugins/node/node.plugin.zsh
1774@@ -1,5 +1,5 @@
1775 # Open the node api for your current version to the optional section.
1776 # TODO: Make the section part easier to use.
1777 function node-docs {
1778- open "http://nodejs.org/docs/$(node --version)/api/all.html#$1"
1779+ open "http://nodejs.org/docs/$(node --version)/api/all.html#all_$1"
1780 }
1781diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
1782index 682bb2667bc2cec79c6edd5870d4d42c871844f2..f278d4f8d2107a682f0ca3da92812f8a99f2ceaf 100644
1783--- a/plugins/osx/osx.plugin.zsh
1784+++ b/plugins/osx/osx.plugin.zsh
1785@@ -2,10 +2,9 @@
1786 # FILE: osx.plugin.zsh
1787 # DESCRIPTION: oh-my-zsh plugin file.
1788 # AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com)
1789-# VERSION: 1.0.1
1790+# VERSION: 1.1.0
1791 # ------------------------------------------------------------------------------
1792
1793-
1794 function tab() {
1795 local command="cd \\\"$PWD\\\""
1796 (( $# > 0 )) && command="${command}; $*"
1797@@ -35,9 +34,67 @@ EOF
1798 launch session "Default Session"
1799 set current_session to current session
1800 tell current_session
1801- write text "${command}"
1802+ write text "${command}; clear;"
1803+ end tell
1804+ end tell
1805+ end tell
1806+EOF
1807+ }
1808+}
1809+
1810+function vsplit_tab() {
1811+ local command="cd \\\"$PWD\\\""
1812+ (( $# > 0 )) && command="${command}; $*"
1813+
1814+ the_app=$(
1815+ osascript 2>/dev/null <<EOF
1816+ tell application "System Events"
1817+ name of first item of (every process whose frontmost is true)
1818+ end tell
1819+EOF
1820+ )
1821+
1822+ [[ "$the_app" == 'iTerm' ]] && {
1823+ osascript 2>/dev/null <<EOF
1824+ tell application "iTerm" to activate
1825+
1826+ tell application "System Events"
1827+ tell process "iTerm"
1828+ tell menu item "Split Vertically With Current Profile" of menu "Shell" of menu bar item "Shell" of menu bar 1
1829+ click
1830+ end tell
1831+ end tell
1832+ keystroke "${command}; clear;"
1833+ keystroke return
1834+ end tell
1835+EOF
1836+ }
1837+}
1838+
1839+function split_tab() {
1840+ local command="cd \\\"$PWD\\\""
1841+ (( $# > 0 )) && command="${command}; $*"
1842+
1843+ the_app=$(
1844+ osascript 2>/dev/null <<EOF
1845+ tell application "System Events"
1846+ name of first item of (every process whose frontmost is true)
1847+ end tell
1848+EOF
1849+ )
1850+
1851+ [[ "$the_app" == 'iTerm' ]] && {
1852+ osascript 2>/dev/null <<EOF
1853+ tell application "iTerm" to activate
1854+
1855+ tell application "System Events"
1856+ tell process "iTerm"
1857+ tell menu item "Split Horizontally With Current Profile" of menu "Shell" of menu bar item "Shell" of menu bar 1
1858+ click
1859 end tell
1860 end tell
1861+ keystroke "${command}; clear;"
1862+ keystroke return
1863 end tell
1864 EOF
1865 }
1866diff --git a/plugins/pass/_pass b/plugins/pass/_pass
1867new file mode 100644
1868index 0000000000000000000000000000000000000000..f6c1a6c4bd36ebe5fd6e347412e730578cc73000
1869--- /dev/null
1870+++ b/plugins/pass/_pass
1871@@ -0,0 +1,119 @@
1872+#compdef pass
1873+#autoload
1874+
1875+# Copyright (C) 2012:
1876+# Johan Venant <jvenant@invicem.pro>
1877+# Brian Mattern <rephorm@rephorm.com>
1878+# Jason A. Donenfeld <Jason@zx2c4.com>.
1879+# Santiago Borrazás <sanbor@gmail.com>
1880+# All Rights Reserved.
1881+# This file is licensed under the GPLv2+. Please see COPYING for more information.
1882+
1883+
1884+_pass () {
1885+ local cmd
1886+ if (( CURRENT > 2)); then
1887+ cmd=${words[2]}
1888+ # Set the context for the subcommand.
1889+ curcontext="${curcontext%:*:*}:pass-$cmd"
1890+ # Narrow the range of words we are looking at to exclude `pass'
1891+ (( CURRENT-- ))
1892+ shift words
1893+ # Run the completion for the subcommand
1894+ case "${cmd}" in
1895+ init)
1896+ _arguments : \
1897+ "-r[re-encrypt existing passwords]" \
1898+ "--reencrypt[re-encrypt existing passwords]"
1899+ _pass_complete_keys
1900+ ;;
1901+ ls|list|edit)
1902+ _pass_complete_entries_with_subdirs
1903+ ;;
1904+ insert)
1905+ _arguments : \
1906+ "-e[echo password to console]" \
1907+ "--echo[echo password to console]" \
1908+ "-m[multiline]" \
1909+ "--multiline[multiline]"
1910+ _pass_complete_entries_with_subdirs
1911+ ;;
1912+ generate)
1913+ _arguments : \
1914+ "-n[don't include symbols in password]" \
1915+ "--no-symbols[don't include symbols in password]" \
1916+ "-c[copy password to the clipboard]" \
1917+ "--clip[copy password to the clipboard]"
1918+ _pass_complete_entries_with_subdirs
1919+ ;;
1920+ rm)
1921+ _arguments : \
1922+ "-f[force deletion]" \
1923+ "--force[force deletion]" \
1924+ "-r[recursively delete]" \
1925+ "--recursive[recursively delete]"
1926+ _pass_complete_entries_with_subdirs
1927+ ;;
1928+ git)
1929+ local -a subcommands
1930+ subcommands=(
1931+ "init:Initialize git repository"
1932+ "push:Push to remote repository"
1933+ "pull:Pull from remote repository"
1934+ "config:Show git config"
1935+ "log:Show git log"
1936+ "reflog:Show git reflog"
1937+ )
1938+ _describe -t commands 'pass git' subcommands
1939+ ;;
1940+ show|*)
1941+ _pass_cmd_show
1942+ ;;
1943+ esac
1944+ else
1945+ local -a subcommands
1946+ subcommands=(
1947+ "init:Initialize new password storage"
1948+ "ls:List passwords"
1949+ "show:Decrypt and print a password"
1950+ "insert:Insert a new password"
1951+ "generate:Generate a new password using pwgen"
1952+ "edit:Edit a password with \$EDITOR"
1953+ "rm:Remove the password"
1954+ "git:Call git on the password store"
1955+ "version:Output version information"
1956+ "help:Output help message"
1957+ )
1958+ _describe -t commands 'pass' subcommands
1959+ _arguments : \
1960+ "--version[Output version information]" \
1961+ "--help[Output help message]"
1962+ _pass_cmd_show
1963+ fi
1964+}
1965+
1966+_pass_cmd_show () {
1967+ _arguments : \
1968+ "-c[put it on the clipboard]" \
1969+ "--clip[put it on the clipboard]"
1970+ _pass_complete_entries