7b0b83623fb54d21932014c9a6267e6dc03976db

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge branch 'master' of github.com:robbyrussell/oh-my-zsh

Diff

  1diff --git a/.gitignore b/.gitignore
  2index 4b555067e1fc5501b0ffccd0c21de1604845f3ae..8fdfae28646a98adc039755bd9bed94b628e7eea 100644
  3--- a/.gitignore
  4+++ b/.gitignore
  5@@ -2,5 +2,6 @@ locals.zsh
  6 log/.zsh_history
  7 projects.zsh
  8 custom/*
  9+!custom/example
 10 !custom/example.zsh
 11 cache
 12diff --git a/README.textile b/README.textile
 13index d01c3310a425d4a31017c2d22006575e6176c408..2dbfbe5a658d8bba2d387bbab272e189ab9e8fca 100644
 14--- a/README.textile
 15+++ b/README.textile
 16@@ -48,7 +48,9 @@ the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty fo
 17 h3. Customization
 18 
 19 If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory.
 20-If you have many functions which go good together you can put them as a *.plugin.zsh file in the @plugin/@ directory and then enable this plugin.
 21+If you have many functions which go good together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin.
 22+If you would like to override the functionality of a plugin distributed with oh-my-zsh, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@.
 23+
 24 
 25 h3. Uninstalling
 26 
 27@@ -68,4 +70,4 @@ This project wouldn't exist without all of our awesome users and contributors.
 28 
 29 * "View our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors
 30 
 31-Thank you so much!
 32+Thank you so much!
 33diff --git a/custom/example/example.plugin.zsh b/custom/example/example.plugin.zsh
 34new file mode 100644
 35index 0000000000000000000000000000000000000000..406f27445b76feced2ff33e2d09b079f6739eca3
 36--- /dev/null
 37+++ b/custom/example/example.plugin.zsh
 38@@ -0,0 +1,2 @@
 39+# Add your own custom plugins in the custom/plugins directory. Plugins placed
 40+# here will override ones with the same name in the main plugins directory.
 41diff --git a/lib/git.zsh b/lib/git.zsh
 42index 2ace3d0e0ff7fab9514dda73d24f4f9c83aed2cd..ce4de5598a1543da5fba3fdc3d7ceaf446400a9d 100644
 43--- a/lib/git.zsh
 44+++ b/lib/git.zsh
 45@@ -52,11 +52,11 @@ git_prompt_status() {
 46   if $(echo "$INDEX" | grep '^R  ' &> /dev/null); then
 47     STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS"
 48   fi
 49-  if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
 50+  if $(echo "$INDEX" | grep '^D ' &> /dev/null); then
 51     STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
 52   fi
 53   if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
 54     STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
 55   fi
 56   echo $STATUS
 57-}
 58+}
 59diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
 60index c8f1a33b80f198fc94dbfa42c835f1a85640968a..dbff1ced9685d00d328b8543852c0ce0219f6c14 100644
 61--- a/oh-my-zsh.sh
 62+++ b/oh-my-zsh.sh
 63@@ -17,7 +17,9 @@ compinit -i
 64 
 65 # Load all of the plugins that were defined in ~/.zshrc
 66 for plugin ($plugins); do
 67-  if [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
 68+  if [ -f $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh ]; then
 69+    source $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh
 70+  elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
 71     source $ZSH/plugins/$plugin/$plugin.plugin.zsh
 72   fi
 73 done
 74diff --git a/plugins/ant/ant.plugin.zsh b/plugins/ant/ant.plugin.zsh
 75index 0544ac92cb18ccfee2fc204b4050cbd1b93923da..23bc7756a9ad98aaebc3ec99c81af69987fdef2f 100644
 76--- a/plugins/ant/ant.plugin.zsh
 77+++ b/plugins/ant/ant.plugin.zsh
 78@@ -1,8 +1,15 @@
 79+stat -f%m . > /dev/null 2>&1
 80+if [ "$?" = 0 ]; then
 81+	stat_cmd=(stat -f%m)
 82+else
 83+	stat_cmd=(stat -L --format=%y)
 84+fi
 85+
 86 _ant_does_target_list_need_generating () {
 87   if [ ! -f .ant_targets ]; then return 0;
 88   else
 89-    accurate=$(stat -f%m .ant_targets)
 90-    changed=$(stat -f%m build.xml)
 91+    accurate=$($stat_cmd -f%m .ant_targets)
 92+    changed=$($stat_cmd -f%m build.xml)
 93     return $(expr $accurate '>=' $changed)
 94   fi
 95 }
 96diff --git a/plugins/brew/_brew b/plugins/brew/_brew
 97index cee1e25f0bdbaae3808392f6bc678e22f653ec80..1dcf0a4bff26c50eec9a8023695cfe409db6053d 100644
 98--- a/plugins/brew/_brew
 99+++ b/plugins/brew/_brew
100@@ -25,10 +25,12 @@ _1st_arguments=(
101   'link:link a formula'
102   'list:list files in a formula or not-installed formulae'
103   'log:git commit log for a formula'
104+  'missing:check all installed formuale for missing dependencies.'
105   'outdated:list formulas for which a newer version is available'
106   'prune:remove dead links'
107   'remove:remove a formula'
108   'search:search for a formula (/regex/ or string)'
109+  'server:start a local web app that lets you browse formulae (requires Sinatra)'
110   'unlink:unlink a formula'
111   'update:freshen up links'
112   'upgrade:upgrade outdated formulae'
113@@ -36,10 +38,14 @@ _1st_arguments=(
114 )
115 
116 local expl
117-local -a formula installed_formulae
118+local -a formulae installed_formulae
119 
120 _arguments \
121-  '(-v --verbose)'{-v,--verbose}'[verbose]' \
122+  '(-v)-v[verbose]' \
123+  '(--cellar)--cellar[brew cellar]' \
124+  '(--config)--config[brew configuration]' \
125+  '(--env)--env[brew environment]' \
126+  '(--repository)--repository[brew repository]' \
127   '(--version)--version[version information]' \
128   '(--prefix)--prefix[where brew lives on this system]' \
129   '(--cache)--cache[brew cache]' \
130@@ -51,20 +57,24 @@ if (( CURRENT == 1 )); then
131 fi
132 
133 case "$words[1]" in
134-  list)
135+  search|-S)
136+    _arguments \
137+      '(--macports)--macports[search the macports repository]' \
138+      '(--fink)--fink[search the fink repository]' ;;
139+  list|ls)
140     _arguments \
141       '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
142+      '(--versions)--versions[list all installed versions of a formula]' \
143       '1: :->forms' &&  return 0
144 
145       if [[ "$state" == forms ]]; then
146         _brew_installed_formulae
147-        _requested installed_formulae expl 'installed formulae' compadd -a installed_formulae
148+        _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
149       fi ;;
150-  install|home|log|info|uses|cat|deps)
151+  install|home|homepage|log|info|abv|uses|cat|deps|edit|options)
152     _brew_all_formulae
153     _wanted formulae expl 'all formulae' compadd -a formulae ;;
154-  remove|edit|xo)
155+  remove|rm|uninstall|unlink|cleanup|link|ln)
156     _brew_installed_formulae
157     _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
158 esac
159-
160diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh
161new file mode 100644
162index 0000000000000000000000000000000000000000..c2e95884e96fd6bb5faba415ebdbe6e9b11153f0
163--- /dev/null
164+++ b/plugins/brew/brew.plugin.zsh
165@@ -0,0 +1 @@
166+alias brews='brew list -1'
167diff --git a/plugins/cap/cap.plugin.zsh b/plugins/cap/cap.plugin.zsh
168index a0fa21d005e628888cf73c9f3e4abc56d1a090b1..8336182d5d8692f609b04d0c9c9c385fc6de5367 100644
169--- a/plugins/cap/cap.plugin.zsh
170+++ b/plugins/cap/cap.plugin.zsh
171@@ -18,4 +18,4 @@ function _cap () {
172   fi
173 }
174 
175-compctl -K _cap cap
176+compctl -K _cap cap
177diff --git a/plugins/compleat/compleat.plugin.zsh b/plugins/compleat/compleat.plugin.zsh
178index 8d16a5687eff49f83cc64d695f9c70a1cff125b5..38f1b396aabf16926d6f0aff06e6f20b2840ab40 100644
179--- a/plugins/compleat/compleat.plugin.zsh
180+++ b/plugins/compleat/compleat.plugin.zsh
181@@ -5,7 +5,6 @@
182 #       VERSION:  1.0.0
183 # ------------------------------------------------------------------------------
184 
185-
186 if (( ${+commands[compleat]} )); then
187   local prefix="${commands[compleat]:h:h}"
188   local setup="${prefix}/share/compleat-1.0/compleat_setup" 
189@@ -19,4 +18,3 @@ if (( ${+commands[compleat]} )); then
190     source "$setup" 
191   fi
192 fi
193-
194diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh
195index df7053ba7c897eff67982911cc754a62eb3970e3..1eb3381136818b82b1915cb5113d1877fc0907a5 100644
196--- a/plugins/github/github.plugin.zsh
197+++ b/plugins/github/github.plugin.zsh
198@@ -4,4 +4,3 @@ if [ "$commands[(I)hub]" ]; then
199     # eval `hub alias -s zsh`
200     function git(){hub "$@"}
201 fi
202-
203diff --git a/plugins/node/node.plugin.zsh b/plugins/node/node.plugin.zsh
204new file mode 100644
205index 0000000000000000000000000000000000000000..519bc18da425f86f2a5fd433cad5075d79a1075a
206--- /dev/null
207+++ b/plugins/node/node.plugin.zsh
208@@ -0,0 +1,5 @@
209+# Open the node api for your current version to the optional section.
210+# TODO: Make the section part easier to use.
211+function node-docs {
212+	open "http://nodejs.org/docs/$(node --version)/api/all.html#$1"
213+}
214diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
215index 81eed5e92af372466fc02bb682a9d5a8b26091e8..a65ca642a2cc31d89507274fe8714933d17b7281 100644
216--- a/plugins/osx/osx.plugin.zsh
217+++ b/plugins/osx/osx.plugin.zsh
218@@ -1,3 +1,9 @@
219+alias showfiles='defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder'
220+alias hidefiles='defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder'
221+
222+# Recursively delete .DS_Store files
223+alias rm-dsstore="find . -name '*.DS_Store' -type f -delete"
224+
225 function savepath() {
226   pwd > ~/.current_path~
227 }
228diff --git a/plugins/pow/pow.plugin.zsh b/plugins/pow/pow.plugin.zsh
229new file mode 100644
230index 0000000000000000000000000000000000000000..6b2a6f2be0f3636c9026eb82a0405eebc79669b4
231--- /dev/null
232+++ b/plugins/pow/pow.plugin.zsh
233@@ -0,0 +1,10 @@
234+# Thanks to Christopher Sexton
235+# https://gist.github.com/965032
236+function kapow {
237+	touch ~/.pow/$1/tmp/restart.txt
238+	if [ $? -eq 0 ]; then
239+		echo "$fg[yellow]Pow restarting $1...$reset_color"
240+	fi
241+}
242+
243+compctl -W ~/.pow -/ kapow
244diff --git a/plugins/ruby/ruby.plugin.zsh b/plugins/ruby/ruby.plugin.zsh
245index 82bf5d49d4420c398520709236a38291b4459cb9..08ca9c60178faf69bb92b4bcd1a5fd66b31f49eb 100644
246--- a/plugins/ruby/ruby.plugin.zsh
247+++ b/plugins/ruby/ruby.plugin.zsh
248@@ -1,4 +1,6 @@
249+# TODO: Make this compatible with rvm.
250+#       Run sudo gem on the system ruby, not the active ruby.
251 alias sgem='sudo gem'
252 
253 # Find ruby file
254-alias rfind='find . -name *.rb | xargs grep -n'
255+alias rfind='find . -name *.rb | xargs grep -n'
256diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh
257index ef934d547a903728e2f91e255601b11db267f70d..24621fe0b57e02b76d3179241ee2c78fc53934eb 100644
258--- a/plugins/rvm/rvm.plugin.zsh
259+++ b/plugins/rvm/rvm.plugin.zsh
260@@ -1,3 +1,44 @@
261-fpath=($ZSH/plugins/rvm $fpath)
262-autoload -U compinit
263-compinit -i
264+alias rubies='rvm list rubies'
265+alias gemsets='rvm gemset list'
266+
267+local ruby18='ruby-1.8.7-p334'
268+local ruby19='ruby-1.9.2-p180'
269+
270+function rb18 {
271+	if [ -z "$1" ]; then
272+		rvm use "$ruby18"
273+	else
274+		rvm use "$ruby18@$1"
275+	fi
276+}
277+
278+_rb18() {compadd `ls -1 $rvm_path/gems | grep "^$ruby18@" | sed -e "s/^$ruby18@//" | awk '{print $1}'`}
279+compdef _rb18 rb18
280+
281+function rb19 {
282+	if [ -z "$1" ]; then
283+		rvm use "$ruby19"
284+	else
285+		rvm use "$ruby19@$1"
286+	fi
287+}
288+
289+_rb19() {compadd `ls -1 $rvm_path/gems | grep "^$ruby19@" | sed -e "s/^$ruby19@//" | awk '{print $1}'`}
290+compdef _rb19 rb19
291+
292+function rvm-update {
293+	rvm get head
294+	rvm reload # TODO: Reload rvm completion?
295+}
296+
297+# TODO: Make this usable w/o rvm.
298+function gems {
299+	local current_ruby=`rvm-prompt i v p`
300+	local current_gemset=`rvm-prompt g`
301+
302+	gem list $@ | sed \
303+		-Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \
304+		-Ee "s|$(echo $rvm_path)|$fg[magenta]\$rvm_path$reset_color|g" \
305+		-Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \
306+		-Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g"
307+}
308diff --git a/plugins/textmate/textmate.plugin.zsh b/plugins/textmate/textmate.plugin.zsh
309index 7c4c14a5fa8b8d0344badb35f7445518caef7b4c..aa2f75f4f7328b03765562b1e82b7408955f1e69 100644
310--- a/plugins/textmate/textmate.plugin.zsh
311+++ b/plugins/textmate/textmate.plugin.zsh
312@@ -1,11 +1,9 @@
313-
314-# TextMate
315 alias et='mate .'
316 alias ett='mate app config lib db public spec test Rakefile Capfile Todo'
317 alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo'
318 alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo'
319 
320-# Editor Ruby file in TextMate
321+# Edit Ruby app in TextMate
322 alias mr='mate CHANGELOG app config db lib public script spec test'
323 
324 function tm() {
325diff --git a/plugins/thor/_thor b/plugins/thor/_thor
326new file mode 100644
327index 0000000000000000000000000000000000000000..9f7ed5aefd35f6fa8d6133cde408f50e56d773f6
328--- /dev/null
329+++ b/plugins/thor/_thor
330@@ -0,0 +1,4 @@
331+#compdef thor
332+#autoload
333+
334+compadd `thor list | grep thor | cut -d " " -f 2`
335diff --git a/themes/minimal.zsh-theme b/themes/minimal.zsh-theme
336new file mode 100644
337index 0000000000000000000000000000000000000000..ee3ab6b224a097a3072d894ac111d11adc7bf77c
338--- /dev/null
339+++ b/themes/minimal.zsh-theme
340@@ -0,0 +1,15 @@
341+ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[white]%}["
342+ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
343+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}●%{$reset_color%}"
344+ZSH_THEME_GIT_PROMPT_CLEAN=""
345+
346+#Customized git status, oh-my-zsh currently does not allow render dirty status before branch
347+git_custom_status() {
348+  local cb=$(current_branch)
349+  if [ -n "$cb" ]; then
350+    echo "- $ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
351+  fi
352+}
353+
354+
355+PROMPT='%2~ $(git_custom_status) »%b '
356diff --git a/themes/trapd00r.zsh-theme b/themes/trapd00r.zsh-theme
357new file mode 100644
358index 0000000000000000000000000000000000000000..cba14c42cab41b9a8f5fc1770b72275a2a273db8
359--- /dev/null
360+++ b/themes/trapd00r.zsh-theme
361@@ -0,0 +1,95 @@
362+# Name:   trapd00r zsh theme
363+# Author: Magnus Woldrich <m@japh.se>
364+#
365+# This theme needs a terminal supporting 256 colors as well as unicode. It also
366+# needs the script that splits up the current path and makes it fancy as located
367+# here: https://github.com/trapd00r/utils/blob/master/zsh_path
368+#
369+# By default it spans over two lines like so:
370+#
371+# scp1@shiva:pts/9-> /home » scp1 (0)
372+# >
373+#
374+# that's  user@host:pts/-> splitted path (return status)
375+#
376+# If the current directory is a git repository, we span 3 lines;
377+#
378+# git❨ master ❩ DIRTY
379+# scp1@shiva:pts/4-> /home » scp1 » dev » utils (0)
380+# >
381+
382+autoload -U add-zsh-hook
383+autoload -Uz vcs_info
384+
385+local c0=$( printf "\e[m")
386+local c1=$( printf "\e[38;5;245m")
387+local c2=$( printf "\e[38;5;250m")
388+local c3=$( printf "\e[38;5;242m")
389+local c4=$( printf "\e[38;5;197m")
390+local c5=$( printf "\e[38;5;225m")
391+local c6=$( printf "\e[38;5;240m")
392+local c7=$( printf "\e[38;5;242m")
393+local c8=$( printf "\e[38;5;244m")
394+local c9=$( printf "\e[38;5;162m")
395+local c10=$(printf "\e[1m")
396+local c11=$(printf "\e[38;5;208m\e[1m")
397+local c12=$(printf "\e[38;5;142m\e[1m")
398+local c13=$(printf "\e[38;5;196m\e[1m")
399+
400+
401+# We dont want to use the extended colorset in the TTY / VC.
402+if [ "$TERM" = "linux" ]; then
403+    c1=$( printf "\e[34;1m")
404+    c2=$( printf "\e[35m")
405+    c3=$( printf "\e[31m")
406+    c4=$( printf "\e[31;1m")
407+    c5=$( printf "\e[32m")
408+    c6=$( printf "\e[32;1m")
409+    c7=$( printf "\e[33m")
410+    c8=$( printf "\e[33;1m")
411+    c9=$( printf "\e[34m")
412+
413+    c11=$(printf "\e[35;1m")
414+    c12=$(printf "\e[36m")
415+    c13=$(printf "\e[31;1m")
416+fi
417+
418+zstyle ':vcs_info:*' actionformats \
419+    '%{$c8%}(%f%s)%{$c7%}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
420+
421+zstyle ':vcs_info:*' formats \
422+    "%{$c8%}%s%%{$c7%}❨ %{$c9%}%{$c11%}%b%{$c7%} ❩%{$reset_color%}%f "
423+
424+zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
425+zstyle ':vcs_info:*' enable git
426+
427+add-zsh-hook precmd prompt_jnrowe_precmd
428+
429+prompt_jnrowe_precmd () {
430+  vcs_info
431+  if [ "${vcs_info_msg_0_}" = "" ]; then
432+    dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
433+    PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%}
434+> '
435+
436+# modified, to be commited
437+  elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then
438+    dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
439+    PROMPT='${vcs_info_msg_0_}%{$30%} %{$bg_bold[red]%}%{$fg_bold[cyan]%}C%{$fg_bold[black]%}OMMIT%{$reset_color%}
440+%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%}
441+> '
442+
443+  elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then
444+    dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
445+    PROMPT='${vcs_info_msg_0_}%{$bg_bold[red]%}%{$fg_bold[blue]%}D%{$fg_bold[black]%}IRTY%{$reset_color%}
446+%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%}
447+%{$c13%}>%{$c0%} '
448+  else
449+    dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
450+    PROMPT='${vcs_info_msg_0_}
451+%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%}
452+> '
453+fi
454+}
455+
456+#  vim: set ft=zsh sw=2 et tw=0: