Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

pulled some oh my zsh stuff here

  • Loading branch information...
commit e8c502535650fd1595645a5ccfe3cb4ce1919549 1 parent fb3595d
@ztane ztane authored
Showing with 10,791 additions and 32 deletions.
  1. +3 −1 .gitignore
  2. +0 −5 NOTES.rst
  3. +89 −0 README.oh-my-zsh.textile
  4. +8 −0 README.rst
  5. +5 −0 zsh-scripts/custom/example.zsh
  6. +2 −0  zsh-scripts/custom/example/example.plugin.zsh
  7. +37 −0 zsh-scripts/etc/oh-my-zsh-settings
  8. +1 −2  zsh-scripts/installall.sh
  9. +72 −0 zsh-scripts/lib/completion.zsh
  10. +10 −0 zsh-scripts/lib/correction.zsh
  11. +39 −0 zsh-scripts/lib/directories.zsh
  12. +3 −0  zsh-scripts/lib/edit-command-line.zsh
  13. +17 −0 zsh-scripts/lib/functions.zsh
  14. +130 −0 zsh-scripts/lib/git.zsh
  15. +6 −0 zsh-scripts/lib/grep.zsh
  16. +15 −0 zsh-scripts/lib/misc.zsh
  17. +8 −0 zsh-scripts/lib/rvm.zsh
  18. +28 −0 zsh-scripts/lib/spectrum.zsh
  19. +37 −0 zsh-scripts/lib/termsupport.zsh
  20. +36 −0 zsh-scripts/lib/theme-and-appearance.zsh
  21. +26 −0 zsh-scripts/plugins/ant/ant.plugin.zsh
  22. +6 −0 zsh-scripts/plugins/apache2-macports/apache2-macports.plugin.zsh
  23. +93 −0 zsh-scripts/plugins/archlinux/archlinux.plugin.zsh
  24. +13 −0 zsh-scripts/plugins/autojump/autojump.plugin.zsh
  25. +71 −0 zsh-scripts/plugins/battery/battery.plugin.zsh
  26. +80 −0 zsh-scripts/plugins/brew/_brew
  27. +1 −0  zsh-scripts/plugins/brew/brew.plugin.zsh
  28. +82 −0 zsh-scripts/plugins/bundler/_bundler
  29. +42 −0 zsh-scripts/plugins/bundler/bundler.plugin.zsh
  30. +13 −0 zsh-scripts/plugins/bwana/bwana.plugin.zsh
  31. +36 −0 zsh-scripts/plugins/cake/cake.plugin.zsh
  32. +10 −0 zsh-scripts/plugins/capistrano/_capistrano
  33. +2 −0  zsh-scripts/plugins/cloudapp/cloudapp.plugin.zsh
  34. +60 −0 zsh-scripts/plugins/cloudapp/cloudapp.rb
  35. +71 −0 zsh-scripts/plugins/coffee/_coffee
  36. +6 −0 zsh-scripts/plugins/colemak/colemak-less
  37. +22 −0 zsh-scripts/plugins/colemak/colemak.plugin.zsh
  38. +5 −0 zsh-scripts/plugins/command-not-found/command-not-found.plugin.zsh
  39. +20 −0 zsh-scripts/plugins/compleat/compleat.plugin.zsh
  40. +29 −0 zsh-scripts/plugins/composer/composer.plugin.zsh
  41. +14 −0 zsh-scripts/plugins/cp/cp.plugin.zsh
  42. +67 −0 zsh-scripts/plugins/cpanm/_cpanm
  43. +186 −0 zsh-scripts/plugins/debian/debian.plugin.zsh
  44. +10 −0 zsh-scripts/plugins/dircycle/dircycle.plugin.zsh
  45. +39 −0 zsh-scripts/plugins/dirpersist/dirpersist.plugin.zsh
  46. +223 −0 zsh-scripts/plugins/django/django.plugin.zsh
  47. +2 −0  zsh-scripts/plugins/encode64/encode64.plugin.zsh
  48. +8 −0 zsh-scripts/plugins/extract/_extract
  49. +80 −0 zsh-scripts/plugins/extract/extract.plugin.zsh
  50. +6 −0 zsh-scripts/plugins/fasd/fasd.plugin.zsh
  51. +44 −0 zsh-scripts/plugins/forklift/forklift.plugin.zsh
  52. +34 −0 zsh-scripts/plugins/gas/_gas
  53. +64 −0 zsh-scripts/plugins/gem/_gem
  54. +285 −0 zsh-scripts/plugins/git-extras/git-extras.plugin.zsh
  55. +337 −0 zsh-scripts/plugins/git-flow/git-flow.plugin.zsh
  56. +348 −0 zsh-scripts/plugins/git-hubflow/git-hubflow.plugin.zsh
  57. +18 −0 zsh-scripts/plugins/git-remote-branch/git-remote-branch.plugin.zsh
  58. +93 −0 zsh-scripts/plugins/git/git.plugin.zsh
  59. +78 −0 zsh-scripts/plugins/gitfast/_git
  60. +2,483 −0 zsh-scripts/plugins/gitfast/git-completion.bash
  61. +290 −0 zsh-scripts/plugins/gitfast/git-prompt.sh
  62. +7 −0 zsh-scripts/plugins/gitfast/gitfast.plugin.zsh
  63. +40 −0 zsh-scripts/plugins/github/_github
  64. +71 −0 zsh-scripts/plugins/github/github.plugin.zsh
  65. +80 −0 zsh-scripts/plugins/gnu-utils/gnu-utils.plugin.zsh
  66. +26 −0 zsh-scripts/plugins/gpg-agent/gpg-agent.plugin.zsh
  67. +119 −0 zsh-scripts/plugins/gradle/gradle.plugin.zsh
  68. +54 −0 zsh-scripts/plugins/grails/grails.plugin.zsh
  69. +159 −0 zsh-scripts/plugins/heroku/_heroku
  70. +7 −0 zsh-scripts/plugins/history-substring-search/README
  71. +12 −0 zsh-scripts/plugins/history-substring-search/history-substring-search.plugin.zsh
  72. +642 −0 zsh-scripts/plugins/history-substring-search/history-substring-search.zsh
  73. +8 −0 zsh-scripts/plugins/history/history.plugin.zsh
  74. +14 −0 zsh-scripts/plugins/jake-node/jake-node.plugin.zsh
  75. +38 −0 zsh-scripts/plugins/jira/jira.plugin.zsh
  76. +4 −0 zsh-scripts/plugins/jruby/jruby.plugin.zsh
  77. +9 −0 zsh-scripts/plugins/kate/kate.plugin.zsh
  78. +185 −0 zsh-scripts/plugins/knife/_knife
  79. +40 −0 zsh-scripts/plugins/laravel/_artisan
  80. +3 −0  zsh-scripts/plugins/laravel/laravel.plugin.zsh
  81. +24 −0 zsh-scripts/plugins/last-working-dir/last-working-dir.plugin.zsh
  82. +27 −0 zsh-scripts/plugins/lein/lein.plugin.zsh
  83. +16 −0 zsh-scripts/plugins/lighthouse/lighthouse.plugin.zsh
  84. +38 −0 zsh-scripts/plugins/lol/lol.plugin.zsh
  85. +89 −0 zsh-scripts/plugins/macports/_port
  86. +8 −0 zsh-scripts/plugins/macports/macports.plugin.zsh
  87. +20 −0 zsh-scripts/plugins/mercurial/mercurial.plugin.zsh
  88. +170 −0 zsh-scripts/plugins/mvn/mvn.plugin.zsh
  89. +8 −0 zsh-scripts/plugins/mysql-macports/mysql-macports.plugin.zsh
  90. +44 −0 zsh-scripts/plugins/nanoc/_nanoc
  91. +9 −0 zsh-scripts/plugins/nanoc/nanoc.plugin.zsh
  92. +5 −0 zsh-scripts/plugins/node/node.plugin.zsh
  93. +1 −0  zsh-scripts/plugins/npm/npm.plugin.zsh
  94. +5 −0 zsh-scripts/plugins/nyan/nyan.plugin.zsh
  95. +5 −0 zsh-scripts/plugins/osx/_man-preview
  96. +156 −0 zsh-scripts/plugins/osx/osx.plugin.zsh
  97. +119 −0 zsh-scripts/plugins/pass/_pass
  98. +149 −0 zsh-scripts/plugins/per-directory-history/per-directory-history.plugin.zsh
  99. +62 −0 zsh-scripts/plugins/perl/perl.plugin.zsh
  100. +19 −0 zsh-scripts/plugins/phing/phing.plugin.zsh
  101. +74 −0 zsh-scripts/plugins/pip/_pip
  102. +66 −0 zsh-scripts/plugins/pow/pow.plugin.zsh
  103. +4 −0 zsh-scripts/plugins/powder/_powder
  104. +12 −0 zsh-scripts/plugins/python/python.plugin.zsh
  105. +16 −0 zsh-scripts/plugins/rails/rails.plugin.zsh
  106. +23 −0 zsh-scripts/plugins/rails3/rails3.plugin.zsh
  107. +6 −0 zsh-scripts/plugins/rake/rake.plugin.zsh
  108. +57 −0 zsh-scripts/plugins/rbenv/rbenv.plugin.zsh
  109. +42 −0 zsh-scripts/plugins/rbfu/rbfu.plugin.zsh
  110. +142 −0 zsh-scripts/plugins/redis-cli/_redis-cli
  111. +4 −0 zsh-scripts/plugins/rsync/rsync.plugin.zsh
  112. +6 −0 zsh-scripts/plugins/ruby/ruby.plugin.zsh
  113. +51 −0 zsh-scripts/plugins/rvm/rvm.plugin.zsh
  114. +54 −0 zsh-scripts/plugins/screen/screen.plugin.zsh
  115. +64 −0 zsh-scripts/plugins/sprunge/sprunge.plugin.zsh
  116. +62 −0 zsh-scripts/plugins/ssh-agent/ssh-agent.plugin.zsh
  117. +21 −0 zsh-scripts/plugins/sublime/sublime.plugin.zsh
  118. +136 −0 zsh-scripts/plugins/supervisor/_supervisorctl
  119. +32 −0 zsh-scripts/plugins/supervisor/_supervisord
  120. +1 −0  zsh-scripts/plugins/supervisor/supervisor.plugin.zsh
  121. +7 −0 zsh-scripts/plugins/suse/suse.plugin.zsh
  122. +62 −0 zsh-scripts/plugins/svn/svn.plugin.zsh
  123. +13 −0 zsh-scripts/plugins/symfony/symfony.plugin.zsh
  124. +19 −0 zsh-scripts/plugins/symfony2/symfony2.plugin.zsh
  125. +11 −0 zsh-scripts/plugins/systemd/systemd.plugin.zsh
  126. +248 −0 zsh-scripts/plugins/taskwarrior/_task
  127. +21 −0 zsh-scripts/plugins/taskwarrior/taskwarrior.plugin.zsh
  128. +39 −0 zsh-scripts/plugins/terminalapp/terminalapp.plugin.zsh
  129. +38 −0 zsh-scripts/plugins/terminitor/_terminitor
  130. +12 −0 zsh-scripts/plugins/textmate/textmate.plugin.zsh
  131. +3 −0  zsh-scripts/plugins/themes/_theme
  132. +24 −0 zsh-scripts/plugins/themes/themes.plugin.zsh
  133. +4 −0 zsh-scripts/plugins/thor/_thor
  134. +36 −0 zsh-scripts/plugins/urltools/urltools.plugin.zsh
  135. +111 −0 zsh-scripts/plugins/vagrant/_vagrant
  136. +40 −0 zsh-scripts/plugins/vi-mode/vi-mode.plugin.zsh
  137. +40 −0 zsh-scripts/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
  138. +23 −0 zsh-scripts/plugins/vundle/vundle.plugin.zsh
  139. +29 −0 zsh-scripts/plugins/wakeonlan/README
  140. +4 −0 zsh-scripts/plugins/wakeonlan/_wake
  141. +14 −0 zsh-scripts/plugins/wakeonlan/wakeonlan.plugin.zsh
  142. +16 −0 zsh-scripts/plugins/yum/yum.plugin.zsh
  143. +41 −0 zsh-scripts/plugins/zeus/README.md
  144. +58 −0 zsh-scripts/plugins/zeus/zeus.plugin.zsh
  145. +9 −5 zsh-scripts/scripts/advancedrc
  146. +52 −0 zsh-scripts/scripts/check_for_upgrade.sh
  147. +6 −17 zsh-scripts/scripts/compile.zsh
  148. +38 −0 zsh-scripts/scripts/install.sh
  149. +80 −0 zsh-scripts/scripts/oh-my-zsh.zsh
  150. +161 −0 zsh-scripts/scripts/require_tool.sh
  151. +96 −0 zsh-scripts/scripts/theme_chooser.sh
  152. +28 −0 zsh-scripts/scripts/uninstall.sh
  153. +19 −0 zsh-scripts/scripts/upgrade.sh
  154. +1 −1  zsh-scripts/setup-skel.zsh
  155. +79 −0 zsh-scripts/themes/ztane.zsh-theme
  156. +1 −1  zsh-scripts/zshrc.template
View
4 .gitignore
@@ -1,3 +1,5 @@
+ztanesh-rcs.zsh
+ztanesh-rcs.zsh.zwc
allrcs
allrcs.zwc
-.DS_Store
+.DS_Store
View
5 NOTES.rst
@@ -1,11 +1,6 @@
Misc notes
============
-Oh my ZSH
-----------------------
-
-`See if they can provide anything useful <https://github.com/robbyrussell/oh-my-zsh>`_
-
Other best practices
----------------------
View
89 README.oh-my-zsh.textile
@@ -0,0 +1,89 @@
+A handful of functions, auto-complete helpers, and stuff that makes you shout...
+
+
+bq. "OH MY ZSHELL!"
+
+h2. Setup
+
+@oh-my-zsh@ should work with any recent release of "zsh":http://www.zsh.org/, the minimum recommended version is 4.3.9.
+
+h3. The automatic installer... (do you trust me?)
+
+You can install this via the command line with either `curl` or `wget`.
+
+h4. via `curl`
+
+@curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh@
+
+h4. via `wget`
+
+@wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@
+
+h3. The manual way
+
+
+1. Clone the repository
+
+ @git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
+
+2. *OPTIONAL* Backup your existing ~/.zshrc file
+
+ @cp ~/.zshrc ~/.zshrc.orig@
+
+3. Create a new zsh config by copying the zsh template we've provided.
+
+ @cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@
+
+
+4. Set zsh as your default shell:
+
+ @chsh -s /bin/zsh@
+
+5. Start / restart zsh (open a new terminal is easy enough...)
+
+h3. Problems?
+
+You _might_ need to modify your PATH in ~/.zshrc if you're not able to find some commands after switching to _Oh My Zsh_.
+
+h2. Usage
+
+* enable the plugins you want in your @~/.zshrc@ (take a look at @plugins/@ to see what's possible)
+** example: @plugins=(git osx ruby)@
+* Theme support: Change the @ZSH_THEME@ environment variable in @~/.zshrc@.
+** Take a look at the "current themes":https://wiki.github.com/robbyrussell/oh-my-zsh/themes that come bundled with _Oh My Zsh_.
+* much much more... take a look at @lib/@ what _Oh My Zsh_ offers...
+
+h2. Useful
+
+the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty for tips.
+
+h3. Customization
+
+If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory.
+If you have many functions which go well together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin.
+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/@.
+
+
+h3. Uninstalling
+
+If you want to uninstall it, just run @uninstall_oh_my_zsh@ from the command line and it'll remove itself and revert you to bash (or your previous zsh config).
+
+h2. Help out!
+
+I'm far from being a zsh-expert and suspect there are many ways to improve. If you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests!
+
+h3. (Don't) Send us your theme! (for now)
+
+-I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.-
+
+We have enough themes for the time being. Please fork the project and add on in there, you can let people know how to grab it from there.
+
+
+
+h2. Contributors
+
+This project wouldn't exist without all of our awesome users and contributors.
+
+* "View our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors
+
+Thank you so much!
View
8 README.rst
@@ -16,6 +16,14 @@ will make your shell more powerful and easier to use.
*Colorize terminal tabs automatically based on which server you are logged in. No need to preconfigure servers - the color is calculated from the hostname*
+Oh my ZSH
+----------------------
+
+As of December 14, 2012, an attempt to merge the code with the `Oh my zsh <https://github.com/robbyrussell/oh-my-zsh>`_ code started, due to the
+enormous amount of plugins readily available for the latter project. The goal is to merge the both projects into something where the startup
+files could be automatically compiled and catenated for superfast startup as is done for the ztanesh currently, while enabling the drop-in
+use of Oh my zsh plugins and themes.
+
Features
------------
View
5 zsh-scripts/custom/example.zsh
@@ -0,0 +1,5 @@
+# Add yourself some shortcuts to projects you often work on
+# Example:
+#
+# brainstormr=/Users/robbyrussell/Projects/development/planetargon/brainstormr
+#
View
2  zsh-scripts/custom/example/example.plugin.zsh
@@ -0,0 +1,2 @@
+# Add your own custom plugins in the custom/plugins directory. Plugins placed
+# here will override ones with the same name in the main plugins directory.
View
37 zsh-scripts/etc/oh-my-zsh-settings
@@ -0,0 +1,37 @@
+# Path to your oh-my-zsh configuration.
+export ZSH=$HOME/.zsh/
+
+# Set name of the theme to load.
+# Look in ~/.oh-my-zsh/themes/
+# Optionally, if you set this to "random", it'll load a random theme each
+# time that oh-my-zsh is loaded.
+ZSH_THEME="ztane"
+
+# Example aliases
+# alias zshconfig="mate ~/.zshrc"
+# alias ohmyzsh="mate ~/.oh-my-zsh"
+
+# Set to this to use case-sensitive completion
+# CASE_SENSITIVE="true"
+
+# Comment this out to disable bi-weekly auto-update checks
+# DISABLE_AUTO_UPDATE="true"
+
+# Uncomment to change how many often would you like to wait before auto-updates occur? (in days)
+# export UPDATE_ZSH_DAYS=13
+
+# Uncomment following line if you want to disable colors in ls
+# DISABLE_LS_COLORS="true"
+
+# Uncomment following line if you want to disable autosetting terminal title.
+# DISABLE_AUTO_TITLE="true"
+
+# Uncomment following line if you want red dots to be displayed while waiting for completion
+# COMPLETION_WAITING_DOTS="true"
+
+# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
+# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
+# Example format: plugins=(rails git textmate ruby lighthouse)
+plugins=(git)
+
+# Customize to your needs...
View
3  zsh-scripts/installall.sh
@@ -62,6 +62,5 @@ echo "Checking out new shell files"
mkdir ~/tools
cd ~/tools
-git init
-git pull http://haapala.iki.fi/tools/.git
+git clone https://github.com/miohtama/ztanesh
~/tools/zsh-scripts/setup.zsh
View
72 zsh-scripts/lib/completion.zsh
@@ -0,0 +1,72 @@
+# fixme - the load process here seems a bit bizarre
+
+unsetopt menu_complete # do not autoselect the first completion entry
+unsetopt flowcontrol
+setopt auto_menu # show completion menu on succesive tab press
+setopt complete_in_word
+setopt always_to_end
+
+WORDCHARS=''
+
+zmodload -i zsh/complist
+
+## case-insensitive (all),partial-word and then substring completion
+if [ "x$CASE_SENSITIVE" = "xtrue" ]; then
+ zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
+ unset CASE_SENSITIVE
+else
+ zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
+fi
+
+zstyle ':completion:*' list-colors ''
+
+# should this be in keybindings?
+bindkey -M menuselect '^o' accept-and-infer-next-history
+
+zstyle ':completion:*:*:*:*:*' menu select
+zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
+zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
+
+# disable named-directories autocompletion
+zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
+cdpath=(.)
+
+# use /etc/hosts and known_hosts for hostname completion
+[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _global_ssh_hosts=()
+[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
+[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
+hosts=(
+ "$_global_ssh_hosts[@]"
+ "$_ssh_hosts[@]"
+ "$_etc_hosts[@]"
+ "$HOST"
+ localhost
+)
+zstyle ':completion:*:hosts' hosts $hosts
+
+# Use caching so that commands like apt and dpkg complete are useable
+zstyle ':completion::complete:*' use-cache 1
+zstyle ':completion::complete:*' cache-path $ZSH/cache/
+
+# Don't complete uninteresting users
+zstyle ':completion:*:*:*:users' ignored-patterns \
+ adm amanda apache avahi beaglidx bin cacti canna clamav daemon \
+ dbus distcache dovecot fax ftp games gdm gkrellmd gopher \
+ hacluster haldaemon halt hsqldb ident junkbust ldap lp mail \
+ mailman mailnull mldonkey mysql nagios \
+ named netdump news nfsnobody nobody nscd ntp nut nx openvpn \
+ operator pcap postfix postgres privoxy pulse pvm quagga radvd \
+ rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs
+
+# ... unless we really want to.
+zstyle '*' single-ignored show
+
+if [ "x$COMPLETION_WAITING_DOTS" = "xtrue" ]; then
+ expand-or-complete-with-dots() {
+ echo -n "\e[31m......\e[0m"
+ zle expand-or-complete
+ zle redisplay
+ }
+ zle -N expand-or-complete-with-dots
+ bindkey "^I" expand-or-complete-with-dots
+fi
View
10 zsh-scripts/lib/correction.zsh
@@ -0,0 +1,10 @@
+setopt correct_all
+
+alias man='nocorrect man'
+alias mv='nocorrect mv'
+alias mysql='nocorrect mysql'
+alias mkdir='nocorrect mkdir'
+alias gist='nocorrect gist'
+alias heroku='nocorrect heroku'
+alias ebuild='nocorrect ebuild'
+alias hpodder='nocorrect hpodder'
View
39 zsh-scripts/lib/directories.zsh
@@ -0,0 +1,39 @@
+# Changing/making/removing directory
+setopt auto_name_dirs
+setopt auto_pushd
+setopt pushd_ignore_dups
+
+alias ..='cd ..'
+alias cd..='cd ..'
+alias cd...='cd ../..'
+alias cd....='cd ../../..'
+alias cd.....='cd ../../../..'
+alias cd/='cd /'
+
+alias 1='cd -'
+alias 2='cd +2'
+alias 3='cd +3'
+alias 4='cd +4'
+alias 5='cd +5'
+alias 6='cd +6'
+alias 7='cd +7'
+alias 8='cd +8'
+alias 9='cd +9'
+
+cd () {
+ if [[ "x$*" == "x..." ]]; then
+ cd ../..
+ elif [[ "x$*" == "x...." ]]; then
+ cd ../../..
+ elif [[ "x$*" == "x....." ]]; then
+ cd ../../../..
+ elif [[ "x$*" == "x......" ]]; then
+ cd ../../../../..
+ else
+ builtin cd "$@"
+ fi
+}
+
+alias md='mkdir -p'
+alias rd=rmdir
+alias d='dirs -v | head -10'
View
3  zsh-scripts/lib/edit-command-line.zsh
@@ -0,0 +1,3 @@
+autoload -U edit-command-line
+zle -N edit-command-line
+bindkey '\C-x\C-e' edit-command-line
View
17 zsh-scripts/lib/functions.zsh
@@ -0,0 +1,17 @@
+function zsh_stats() {
+ 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
+}
+
+function uninstall_oh_my_zsh() {
+ /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/scripts/uninstall.sh
+}
+
+function upgrade_oh_my_zsh() {
+ /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/scripts/upgrade.sh
+}
+
+function take() {
+ mkdir -p $1
+ cd $1
+}
+
View
130 zsh-scripts/lib/git.zsh
@@ -0,0 +1,130 @@
+# get the name of the branch we are on
+function git_prompt_info() {
+ ref=$(git symbolic-ref HEAD 2> /dev/null) || \
+ ref=$(git rev-parse --short HEAD 2> /dev/null) || return
+ echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
+}
+
+
+# Checks if working tree is dirty
+parse_git_dirty() {
+ local SUBMODULE_SYNTAX=''
+ if [[ $POST_1_7_2_GIT -gt 0 ]]; then
+ SUBMODULE_SYNTAX="--ignore-submodules=dirty"
+ fi
+ if [[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]]; then
+ echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
+ else
+ echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
+ fi
+}
+
+# get the difference between the local and remote branches
+git_remote_status() {
+ remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
+ if [[ -n ${remote} ]] ; then
+ ahead=$(git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
+ behind=$(git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
+
+ if [ $ahead -eq 0 ] && [ $behind -gt 0 ]
+ then
+ echo "$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE"
+ elif [ $ahead -gt 0 ] && [ $behind -eq 0 ]
+ then
+ echo "$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
+ elif [ $ahead -gt 0 ] && [ $behind -gt 0 ]
+ then
+ echo "$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE"
+ fi
+ fi
+}
+
+# Checks if there are commits ahead from remote
+function git_prompt_ahead() {
+ if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
+ echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
+ fi
+}
+
+# Formats prompt string for current git commit short SHA
+function git_prompt_short_sha() {
+ SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
+}
+
+# Formats prompt string for current git commit long SHA
+function git_prompt_long_sha() {
+ SHA=$(git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
+}
+
+# Get the status of the working tree
+git_prompt_status() {
+ INDEX=$(git status --porcelain -b 2> /dev/null)
+ STATUS=""
+ if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
+ fi
+ if $(echo "$INDEX" | grep '^A ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
+ elif $(echo "$INDEX" | grep '^M ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
+ fi
+ if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
+ elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
+ elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
+ fi
+ if $(echo "$INDEX" | grep '^R ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS"
+ fi
+ if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
+ elif $(echo "$INDEX" | grep '^D ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
+ elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
+ fi
+ if $(git rev-parse --verify refs/stash >/dev/null 2>&1); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_STASHED$STATUS"
+ fi
+ if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
+ fi
+ if $(echo "$INDEX" | grep '^## .*ahead' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS"
+ fi
+ if $(echo "$INDEX" | grep '^## .*behind' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS"
+ fi
+ if $(echo "$INDEX" | grep '^## .*diverged' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
+ fi
+ echo $STATUS
+}
+
+#compare the provided version of git to the version installed and on path
+#prints 1 if input version <= installed version
+#prints -1 otherwise
+function git_compare_version() {
+ local INPUT_GIT_VERSION=$1;
+ local INSTALLED_GIT_VERSION
+ INPUT_GIT_VERSION=(${(s/./)INPUT_GIT_VERSION});
+ INSTALLED_GIT_VERSION=($(git --version));
+ INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]});
+
+ for i in {1..3}; do
+ if [[ $INSTALLED_GIT_VERSION[$i] -lt $INPUT_GIT_VERSION[$i] ]]; then
+ echo -1
+ return 0
+ fi
+ done
+ echo 1
+}
+
+#this is unlikely to change so make it all statically assigned
+POST_1_7_2_GIT=$(git_compare_version "1.7.2")
+#clean up the namespace slightly by removing the checker function
+unset -f git_compare_version
+
+
View
6 zsh-scripts/lib/grep.zsh
@@ -0,0 +1,6 @@
+#
+# Color grep results
+# Examples: http://rubyurl.com/ZXv
+#
+export GREP_OPTIONS='--color=auto'
+export GREP_COLOR='1;32'
View
15 zsh-scripts/lib/misc.zsh
@@ -0,0 +1,15 @@
+## smart urls
+autoload -U url-quote-magic
+zle -N self-insert url-quote-magic
+
+## file rename magick
+bindkey "^[m" copy-prev-shell-word
+
+## jobs
+setopt long_list_jobs
+
+## pager
+export PAGER="less"
+export LESS="-R"
+
+export LC_CTYPE=$LANG
View
8 zsh-scripts/lib/rvm.zsh
@@ -0,0 +1,8 @@
+# get the name of the ruby version
+function rvm_prompt_info() {
+ [ -f $HOME/.rvm/bin/rvm-prompt ] || return
+ local rvm_prompt
+ rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
+ [[ "${rvm_prompt}x" == "x" ]] && return
+ echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
+}
View
28 zsh-scripts/lib/spectrum.zsh
@@ -0,0 +1,28 @@
+#! /bin/zsh
+# A script to make using 256 colors in zsh less painful.
+# P.C. Shyamshankar <sykora@lucentbeing.com>
+# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
+
+typeset -Ag FX FG BG
+
+FX=(
+ reset "%{%}"
+ bold "%{%}" no-bold "%{%}"
+ italic "%{%}" no-italic "%{%}"
+ underline "%{%}" no-underline "%{%}"
+ blink "%{%}" no-blink "%{%}"
+ reverse "%{%}" no-reverse "%{%}"
+)
+
+for color in {000..255}; do
+ FG[$color]="%{[38;5;${color}m%}"
+ BG[$color]="%{[48;5;${color}m%}"
+done
+
+# Show all 256 colors with color number
+function spectrum_ls() {
+ for code in {000..255}; do
+ print -P -- "$code: %F{$code}Test%f"
+ done
+}
+
View
37 zsh-scripts/lib/termsupport.zsh
@@ -0,0 +1,37 @@
+#usage: title short_tab_title looooooooooooooooooooooggggggg_windows_title
+#http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
+#Fully support screen, iterm, and probably most modern xterm and rxvt
+#Limited support for Apple Terminal (Terminal can't set window or tab separately)
+function title {
+ if [[ "$DISABLE_AUTO_TITLE" == "true" ]] || [[ "$EMACS" == *term* ]]; then
+ return
+ fi
+ if [[ "$TERM" == screen* ]]; then
+ print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
+ elif [[ "$TERM_PROGRAM" == "Apple_Terminal" ]]; then
+ print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
+ elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
+ print -Pn "\e]2;$2:q\a" #set window name
+ print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
+ fi
+}
+
+ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
+ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
+
+#Appears when you have the prompt
+function omz_termsupport_precmd {
+ title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
+}
+
+#Appears at the beginning of (and during) of command execution
+function omz_termsupport_preexec {
+ emulate -L zsh
+ setopt extended_glob
+ local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
+ title "$CMD" "%100>...>${2:gs/%/%%}%<<"
+}
+
+autoload -U add-zsh-hook
+add-zsh-hook precmd omz_termsupport_precmd
+add-zsh-hook preexec omz_termsupport_preexec
View
36 zsh-scripts/lib/theme-and-appearance.zsh
@@ -0,0 +1,36 @@
+# ls colors
+autoload colors; colors;
+export LSCOLORS="Gxfxcxdxbxegedabagacad"
+#export LS_COLORS
+
+# Enable ls colors
+if [ "$DISABLE_LS_COLORS" != "true" ]
+then
+ # Find the option for using colors in ls, depending on the version: Linux or BSD
+ ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
+fi
+
+#setopt no_beep
+setopt auto_cd
+setopt multios
+setopt cdablevarS
+
+if [[ x$WINDOW != x ]]
+then
+ SCREEN_NO="%B$WINDOW%b "
+else
+ SCREEN_NO=""
+fi
+
+# Apply theming defaults
+PS1="%n@%m:%~%# "
+
+# git theming default: Variables for theming the git info prompt
+ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name
+ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt
+ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty
+ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean
+
+# Setup the prompt with pretty colors
+setopt prompt_subst
+
View
26 zsh-scripts/plugins/ant/ant.plugin.zsh
@@ -0,0 +1,26 @@
+stat -f%m . > /dev/null 2>&1
+if [ "$?" = 0 ]; then
+ stat_cmd=(stat -f%m)
+else
+ stat_cmd=(stat -L --format=%Y)
+fi
+
+_ant_does_target_list_need_generating () {
+ if [ ! -f .ant_targets ]; then return 0;
+ else
+ accurate=$($stat_cmd .ant_targets)
+ changed=$($stat_cmd build.xml)
+ return $(expr $accurate '>=' $changed)
+ fi
+}
+
+_ant () {
+ if [ -f build.xml ]; then
+ if _ant_does_target_list_need_generating; then
+ sed -n '/<target/s/<target.*name="\([^"]*\).*$/\1/p' build.xml > .ant_targets
+ fi
+ compadd `cat .ant_targets`
+ fi
+}
+
+compdef _ant ant
View
6 zsh-scripts/plugins/apache2-macports/apache2-macports.plugin.zsh
@@ -0,0 +1,6 @@
+# commands to control local apache2 server installation
+# paths are for osx installation via macports
+
+alias apache2start='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper start'
+alias apache2stop='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper stop'
+alias apache2restart='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart'
View
93 zsh-scripts/plugins/archlinux/archlinux.plugin.zsh
@@ -0,0 +1,93 @@
+# Archlinux zsh aliases and functions
+# Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins
+
+# Look for yaourt, and add some useful functions if we have it.
+if [[ -x `which yaourt` ]]; then
+ upgrade () {
+ yaourt -Syu
+ }
+ alias yaconf='yaourt -C' # Fix all configuration files with vimdiff
+ # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
+ alias yaupg='yaourt -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system.
+ alias yasu='yaourt --sucre' # Same as yaupg, but without confirmation
+ alias yain='yaourt -S' # Install specific package(s) from the repositories
+ alias yains='yaourt -U' # Install specific package not from the repositories but from a file
+ alias yare='yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies
+ alias yarem='yaourt -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies
+ alias yarep='yaourt -Si' # Display information about a given package in the repositories
+ alias yareps='yaourt -Ss' # Search for package(s) in the repositories
+ alias yaloc='yaourt -Qi' # Display information about a given package in the local database
+ alias yalocs='yaourt -Qs' # Search for package(s) in the local database
+ # Additional yaourt alias examples
+ if [[ -x `which abs` ]]; then
+ alias yaupd='yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
+ else
+ alias yaupd='yaourt -Sy' # Update and refresh the local package and ABS databases against repositories
+ fi
+ alias yainsd='yaourt -S --asdeps' # Install given package(s) as dependencies of another package
+ alias yamir='yaourt -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
+else
+ upgrade() {
+ sudo pacman -Syu
+ }
+fi
+
+# Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
+alias pacupg='sudo pacman -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system.
+alias pacin='sudo pacman -S' # Install specific package(s) from the repositories
+alias pacins='sudo pacman -U' # Install specific package not from the repositories but from a file
+alias pacre='sudo pacman -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies
+alias pacrem='sudo pacman -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies
+alias pacrep='pacman -Si' # Display information about a given package in the repositories
+alias pacreps='pacman -Ss' # Search for package(s) in the repositories
+alias pacloc='pacman -Qi' # Display information about a given package in the local database
+alias paclocs='pacman -Qs' # Search for package(s) in the local database
+# Additional pacman alias examples
+if [[ -x `which abs` ]]; then
+ alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
+else
+ alias pacupd='sudo pacman -Sy' # Update and refresh the local package and ABS databases against repositories
+fi
+alias pacinsd='sudo pacman -S --asdeps' # Install given package(s) as dependencies of another package
+alias pacmir='sudo pacman -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
+
+# https://bbs.archlinux.org/viewtopic.php?id=93683
+paclist() {
+ sudo pacman -Qei $(pacman -Qu|cut -d" " -f 1)|awk ' BEGIN {FS=":"}/^Name/{printf("\033[1;36m%s\033[1;37m", $2)}/^Description/{print $2}'
+}
+
+alias paclsorphans='sudo pacman -Qdt'
+alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)'
+
+pacdisowned() {
+ tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$
+ db=$tmp/db
+ fs=$tmp/fs
+
+ mkdir "$tmp"
+ trap 'rm -rf "$tmp"' EXIT
+
+ pacman -Qlq | sort -u > "$db"
+
+ find /bin /etc /lib /sbin /usr \
+ ! -name lost+found \
+ \( -type d -printf '%p/\n' -o -print \) | sort > "$fs"
+
+ comm -23 "$fs" "$db"
+}
+
+pacmanallkeys() {
+ # Get all keys for developers and trusted users
+ curl https://www.archlinux.org/{developers,trustedusers}/ |
+ awk -F\" '(/pgp.mit.edu/) {sub(/.*search=0x/,"");print $1}' |
+ xargs sudo pacman-key --recv-keys
+}
+
+pacmansignkeys() {
+ for key in $*; do
+ sudo pacman-key --recv-keys $key
+ sudo pacman-key --lsign-key $key
+ printf 'trust\n3\n' | sudo gpg --homedir /etc/pacman.d/gnupg \
+ --no-permission-warning --command-fd 0 --edit-key $key
+ done
+}
View
13 zsh-scripts/plugins/autojump/autojump.plugin.zsh
@@ -0,0 +1,13 @@
+if [ $commands[autojump] ]; then # check if autojump is installed
+ if [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package
+ . /usr/share/autojump/autojump.zsh
+ elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
+ . /etc/profile.d/autojump.zsh
+ elif [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation
+ . $HOME/.autojump/etc/profile.d/autojump.zsh
+ elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports
+ . /opt/local/etc/profile.d/autojump.zsh
+ elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.zsh ]; then # mac os x with brew
+ . `brew --prefix`/etc/autojump.zsh
+ fi
+fi
View
71 zsh-scripts/plugins/battery/battery.plugin.zsh
@@ -0,0 +1,71 @@
+###########################################
+# Battery plugin for oh-my-zsh #
+# Original Author: Peter hoeg (peterhoeg) #
+# Email: peter@speartail.com #
+###########################################
+# Author: Sean Jones (neuralsandwich) #
+# Email: neuralsandwich@gmail.com #
+# Modified to add support for Apple Mac #
+###########################################
+
+if [[ $(uname) == "Darwin" ]] ; then
+
+ function battery_pct_remaining() {
+ if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
+ typeset -F maxcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"MaxCapacity"\ =\ ' | sed -e 's/^.*"MaxCapacity"\ =\ //')
+ typeset -F currentcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"CurrentCapacity"\ =\ ' | sed -e 's/^.*CurrentCapacity"\ =\ //')
+ integer i=$(((currentcapacity/maxcapacity) * 100))
+ echo $i
+ else
+ echo "External Power"
+ fi
+ }
+
+ function battery_time_remaining() {
+ if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
+ timeremaining=$(ioreg -rc "AppleSmartBattery"| grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //')
+ echo "~$((timeremaining / 60)):$((timeremaining % 60))"
+ else
+ echo ""
+ fi
+ }
+
+ function battery_pct_prompt () {
+ if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
+ b=$(battery_pct_remaining)
+ if [ $b -gt 50 ] ; then
+ color='green'
+ elif [ $b -gt 20 ] ; then
+ color='yellow'
+ else
+ color='red'
+ fi
+ echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
+ else
+ echo ""
+ fi
+ }
+
+elif [[ $(uname) == "Linux" ]] ; then
+
+ if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
+ function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" }
+ function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') }
+ function battery_pct_prompt() {
+ b=$(battery_pct_remaining)
+ if [ $b -gt 50 ] ; then
+ color='green'
+ elif [ $b -gt 20 ] ; then
+ color='yellow'
+ else
+ color='red'
+ fi
+ echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
+ }
+ else
+ error_msg='no battery'
+ function battery_pct_remaining() { echo $error_msg }
+ function battery_time_remaining() { echo $error_msg }
+ function battery_pct_prompt() { echo '' }
+ fi
+fi
View
80 zsh-scripts/plugins/brew/_brew
@@ -0,0 +1,80 @@
+#compdef brew
+#autoload
+
+# imported from the latest homebrew contributions
+
+_brew_all_formulae() {
+ formulae=(`brew search`)
+}
+
+_brew_installed_formulae() {
+ installed_formulae=(`brew list`)
+}
+
+local -a _1st_arguments
+_1st_arguments=(
+ 'cat:display formula file for a formula'
+ 'cleanup:uninstall unused and old versions of packages'
+ 'create:create a new formula'
+ 'deps:list dependencies and dependants of a formula'
+ 'doctor:audits your installation for common issues'
+ 'edit:edit a formula'
+ 'home:visit the homepage of a formula or the brew project'
+ 'info:information about a formula'
+ 'install:install a formula'
+ 'link:link a formula'
+ 'list:list files in a formula or not-installed formulae'
+ 'log:git commit log for a formula'
+ 'missing:check all installed formuale for missing dependencies.'
+ 'outdated:list formulas for which a newer version is available'
+ 'prune:remove dead links'
+ 'remove:remove a formula'
+ 'search:search for a formula (/regex/ or string)'
+ 'server:start a local web app that lets you browse formulae (requires Sinatra)'
+ 'unlink:unlink a formula'
+ 'update:freshen up links'
+ 'upgrade:upgrade outdated formulae'
+ 'uses:show formulas which depend on a formula'
+)
+
+local expl
+local -a formulae installed_formulae
+
+_arguments \
+ '(-v)-v[verbose]' \
+ '(--cellar)--cellar[brew cellar]' \
+ '(--config)--config[brew configuration]' \
+ '(--env)--env[brew environment]' \
+ '(--repository)--repository[brew repository]' \
+ '(--version)--version[version information]' \
+ '(--prefix)--prefix[where brew lives on this system]' \
+ '(--cache)--cache[brew cache]' \
+ '*:: :->subcmds' && return 0
+
+if (( CURRENT == 1 )); then
+ _describe -t commands "brew subcommand" _1st_arguments
+ return
+fi
+
+case "$words[1]" in
+ search|-S)
+ _arguments \
+ '(--macports)--macports[search the macports repository]' \
+ '(--fink)--fink[search the fink repository]' ;;
+ list|ls)
+ _arguments \
+ '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
+ '(--versions)--versions[list all installed versions of a formula]' \
+ '1: :->forms' && return 0
+
+ if [[ "$state" == forms ]]; then
+ _brew_installed_formulae
+ _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
+ fi ;;
+ install|home|homepage|log|info|abv|uses|cat|deps|edit|options)
+ _brew_all_formulae
+ _wanted formulae expl 'all formulae' compadd -a formulae ;;
+ remove|rm|uninstall|unlink|cleanup|link|ln)
+ _brew_installed_formulae
+ _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
+esac
View
1  zsh-scripts/plugins/brew/brew.plugin.zsh
@@ -0,0 +1 @@
+alias brews='brew list -1'
View
82 zsh-scripts/plugins/bundler/_bundler
@@ -0,0 +1,82 @@
+#compdef bundle
+
+local curcontext="$curcontext" state line _gems _opts ret=1
+
+_arguments -C -A "-v" -A "--version" \
+ '(- 1 *)'{-v,--version}'[display version information]' \
+ '1: :->cmds' \
+ '*:: :->args' && ret=0
+
+case $state in
+ cmds)
+ _values "bundle command" \
+ "install[Install the gems specified by the Gemfile or Gemfile.lock]" \
+ "update[Update dependencies to their latest versions]" \
+ "package[Package the .gem files required by your application]" \
+ "exec[Execute a script in the context of the current bundle]" \
+ "config[Specify and read configuration options for bundler]" \
+ "check[Determine whether the requirements for your application are installed]" \
+ "list[Show all of the gems in the current bundle]" \
+ "show[Show the source location of a particular gem in the bundle]" \
+ "console[Start an IRB session in the context of the current bundle]" \
+ "open[Open an installed gem in the editor]" \
+ "viz[Generate a visual representation of your dependencies]" \
+ "init[Generate a simple Gemfile, placed in the current directory]" \
+ "gem[Create a simple gem, suitable for development with bundler]" \
+ "help[Describe available tasks or one specific task]"
+ ret=0
+ ;;
+ args)
+ case $line[1] in
+ help)
+ _values 'commands' \
+ 'install' \
+ 'update' \
+ 'package' \
+ 'exec' \
+ 'config' \
+ 'check' \
+ 'list' \
+ 'show' \
+ 'console' \
+ 'open' \
+ 'viz' \
+ 'init' \
+ 'gem' \
+ 'help' && ret=0
+ ;;
+ install)
+ _arguments \
+ '(--no-color)--no-color[disable colorization in output]' \
+ '(--local)--local[do not attempt to connect to rubygems.org]' \
+ '(--quiet)--quiet[only output warnings and errors]' \
+ '(--gemfile)--gemfile=-[use the specified gemfile instead of Gemfile]:gemfile' \
+ '(--system)--system[install to the system location]' \
+ '(--deployment)--deployment[install using defaults tuned for deployment environments]' \
+ '(--frozen)--frozen[do not allow the Gemfile.lock to be updated after this install]' \
+ '(--path)--path=-[specify a different path than the system default]:path:_files' \
+ '(--binstubs)--binstubs=-[generate bin stubs for bundled gems to ./bin]:directory:_files' \
+ '(--without)--without=-[exclude gems that are part of the specified named group]:groups'
+ ret=0
+ ;;
+ exec)
+ _normal && ret=0
+ ;;
+ (open|show)
+ _gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') )
+ if [[ $_gems != "" ]]; then
+ _values 'gems' $_gems && ret=0
+ fi
+ ;;
+ *)
+ _opts=( $(bundle help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') )
+ _opts+=( $(bundle help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') )
+ if [[ $_opts != "" ]]; then
+ _values 'options' $_opts && ret=0
+ fi
+ ;;
+ esac
+ ;;
+esac
+
+return ret
View
42 zsh-scripts/plugins/bundler/bundler.plugin.zsh
@@ -0,0 +1,42 @@
+alias be="bundle exec"
+alias bi="bundle install"
+alias bl="bundle list"
+alias bp="bundle package"
+alias bu="bundle update"
+
+# The following is based on https://github.com/gma/bundler-exec
+
+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)
+
+## Functions
+
+_bundler-installed() {
+ which bundle > /dev/null 2>&1
+}
+
+_within-bundled-project() {
+ local check_dir=$PWD
+ while [ $check_dir != "/" ]; do
+ [ -f "$check_dir/Gemfile" ] && return
+ check_dir="$(dirname $check_dir)"
+ done
+ false
+}
+
+_run-with-bundler() {
+ if _bundler-installed && _within-bundled-project; then
+ bundle exec $@
+ else
+ $@
+ fi
+}
+
+## Main program
+for cmd in $bundled_commands; do
+ eval "function bundled_$cmd () { _run-with-bundler $cmd \$@}"
+ alias $cmd=bundled_$cmd
+
+ if which _$cmd > /dev/null 2>&1; then
+ compdef _$cmd bundled_$cmd=$cmd
+ fi
+done
View
13 zsh-scripts/plugins/bwana/bwana.plugin.zsh
@@ -0,0 +1,13 @@
+#
+# Requires http://www.bruji.com/bwana/
+#
+if [[ -e /Applications/Bwana.app ]] ||
+ ( system_profiler -detailLevel mini SPApplicationsDataType | grep -q Bwana )
+then
+ function man() {
+ open "man:$1"
+ }
+else
+ echo "Bwana lets you read man files in Safari through a man: URI scheme"
+ echo "To use it within Zsh, install it from http://www.bruji.com/bwana/"
+fi
View
36 zsh-scripts/plugins/cake/cake.plugin.zsh
@@ -0,0 +1,36 @@
+# Set this to 1 if you want to cache the tasks
+_cake_cache_task_list=1
+
+# Cache filename
+_cake_task_cache_file='.cake_task_cache'
+
+_cake_get_target_list () {
+ cake | grep '^cake ' | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$'
+}
+
+_cake_does_target_list_need_generating () {
+
+ if [ ${_cake_cache_task_list} -eq 0 ]; then
+ return 1;
+ fi
+
+ if [ ! -f ${_cake_task_cache_file} ]; then return 0;
+ else
+ accurate=$(stat -f%m $_cake_task_cache_file)
+ changed=$(stat -f%m Cakefile)
+ return $(expr $accurate '>=' $changed)
+ fi
+}
+
+_cake () {
+ if [ -f Cakefile ]; then
+ if _cake_does_target_list_need_generating; then
+ _cake_get_target_list > ${_cake_task_cache_file}
+ compadd `cat ${_cake_task_cache_file}`
+ else
+ compadd `_cake_get_target_list`
+ fi
+ fi
+}
+
+compdef _cake cake
View
10 zsh-scripts/plugins/capistrano/_capistrano
@@ -0,0 +1,10 @@
+#compdef cap
+#autoload
+
+if [ -f config/deploy.rb ]; then
+ if [[ ! -f .cap_tasks~ || config/deploy.rb -nt .cap_tasks~ ]]; then
+ echo "\nGenerating .cap_tasks~..." > /dev/stderr
+ cap --tasks | grep '#' | cut -d " " -f 2 > .cap_tasks~
+ fi
+ compadd `cat .cap_tasks~`
+fi
View
2  zsh-scripts/plugins/cloudapp/cloudapp.plugin.zsh
@@ -0,0 +1,2 @@
+#!/bin/zsh
+alias cloudapp=$ZSH/plugins/cloudapp/cloudapp.rb
View
60 zsh-scripts/plugins/cloudapp/cloudapp.rb
@@ -0,0 +1,60 @@
+#!/usr/bin/env ruby
+#
+# cloudapp
+# Zach Holman / @holman
+#
+# Uploads a file from the command line to CloudApp, drops it into your
+# clipboard (on a Mac, at least).
+#
+# Example:
+#
+# cloudapp drunk-blake.png
+#
+# This requires Aaron Russell's cloudapp_api gem:
+#
+# gem install cloudapp_api
+#
+# Requires you set your CloudApp credentials in ~/.cloudapp as a simple file of:
+#
+# email
+# password
+
+require 'rubygems'
+begin
+ require 'cloudapp_api'
+rescue LoadError
+ puts "You need to install cloudapp_api: gem install cloudapp_api"
+ exit!(1)
+end
+
+config_file = "#{ENV['HOME']}/.cloudapp"
+unless File.exist?(config_file)
+ puts "You need to type your email and password (one per line) into "+
+ "`~/.cloudapp`"
+ exit!(1)
+end
+
+email,password = File.read(config_file).split("\n")
+
+class HTTParty::Response
+ # Apparently HTTPOK.ok? IS NOT OKAY WTFFFFFFFFFFUUUUUUUUUUUUUU
+ # LETS MONKEY PATCH IT I FEEL OKAY ABOUT IT
+ def ok? ; true end
+end
+
+if ARGV[0].nil?
+ puts "You need to specify a file to upload."
+ exit!(1)
+end
+
+CloudApp.authenticate(email,password)
+url = CloudApp::Item.create(:upload, {:file => ARGV[0]}).url
+
+# Say it for good measure.
+puts "Uploaded to #{url}."
+
+# Get the embed link.
+url = "#{url}/#{ARGV[0].split('/').last}"
+
+# Copy it to your (Mac's) clipboard.
+`echo '#{url}' | tr -d "\n" | pbcopy`
View
71 zsh-scripts/plugins/coffee/_coffee
@@ -0,0 +1,71 @@
+#compdef coffee
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Coffee.js v0.6.11 (http://coffeejs.org)
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Mario Fernandez (https://github.com/sirech)
+#
+# ------------------------------------------------------------------------------
+
+local curcontext="$curcontext" state line ret=1
+typeset -A opt_args
+
+_arguments -C \
+ '(- *)'{-h,--help}'[display this help message]' \
+ '(- *)'{-v,--version}'[display the version number]' \
+ '(-b --bare)'{-b,--bare}'[compile without a top-level function wrapper]' \
+ '(-e --eval)'{-e,--eval}'[pass a string from the command line as input]:Inline Script' \
+ '(-i --interactive)'{-i,--interactive}'[run an interactive CoffeeScript REPL]' \
+ '(-j --join)'{-j,--join}'[concatenate the source CoffeeScript before compiling]:Destination JS file:_files -g "*.js"' \
+ '(-l --lint)'{-l,--lint}'[pipe the compiled JavaScript through JavaScript Lint]' \
+ '(--nodejs)--nodejs[pass options directly to the "node" binary]' \
+ '(-c --compile)'{-c,--compile}'[compile to JavaScript and save as .js files]' \
+ '(-o --output)'{-o,--output}'[set the output directory for compiled JavaScript]:Output Directory:_files -/' \
+ '(-n -t -p)'{-n,--nodes}'[print out the parse tree that the parser produces]' \
+ '(-n -t -p)'{-p,--print}'[print out the compiled JavaScript]' \
+ '(-n -t -p)'{-t,--tokens}'[print out the tokens that the lexer/rewriter produce]' \
+ '(-r --require)'{-r,--require}'[require a library before executing your script]:library' \
+ '(-s --stdio)'{-s,--stdio}'[listen for and compile scripts over stdio]' \
+ '(-w --watch)'{-w,--watch}'[watch scripts for changes and rerun commands]' \
+ '*:script or directory:_files' && ret=0
+
+return ret
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
6 zsh-scripts/plugins/colemak/colemak-less
@@ -0,0 +1,6 @@
+n forw-line
+e back-line
+k repeat-search
+\ek repeat-search-all
+K reverse-search
+\eK reverse-search-all
View
22 zsh-scripts/plugins/colemak/colemak.plugin.zsh
@@ -0,0 +1,22 @@
+# ctrl-j newline
+bindkey '^n' accept-line
+bindkey -a '^n' accept-line
+
+# another rotation to match qwerty
+bindkey -a 'n' down-line-or-history
+bindkey -a 'e' up-line-or-history
+bindkey -a 'i' vi-forward-char
+
+# make qwerty
+bindkey -a 'k' vi-repeat-search
+bindkey -a 'K' vi-rev-repeat-search
+bindkey -a 'u' vi-insert
+bindkey -a 'U' vi-insert-bol
+bindkey -a 'l' vi-undo-change
+bindkey -a 'N' vi-join
+
+# spare
+bindkey -a 'j' vi-forward-word-end
+bindkey -a 'J' vi-forward-blank-word-end
+
+lesskey $ZSH_CUSTOM/plugins/colemak/colemak-less
View
5 zsh-scripts/plugins/command-not-found/command-not-found.plugin.zsh
@@ -0,0 +1,5 @@
+# Uses the command-not-found package zsh support
+# as seen in http://www.porcheron.info/command-not-found-for-zsh/
+# this is installed in Ubuntu
+
+[[ -e /etc/zsh_command_not_found ]] && source /etc/zsh_command_not_found
View
20 zsh-scripts/plugins/compleat/compleat.plugin.zsh
@@ -0,0 +1,20 @@
+# ------------------------------------------------------------------------------
+# FILE: compleat.plugin.zsh
+# DESCRIPTION: oh-my-zsh plugin file.
+# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com)
+# VERSION: 1.0.0
+# ------------------------------------------------------------------------------
+
+if (( ${+commands[compleat]} )); then
+ local prefix="${commands[compleat]:h:h}"
+ local setup="${prefix}/share/compleat-1.0/compleat_setup"
+
+ if [[ -f "$setup" ]]; then
+ if ! bashcompinit >/dev/null 2>&1; then
+ autoload -U bashcompinit
+ bashcompinit -i
+ fi
+
+ source "$setup"
+ fi
+fi
View
29 zsh-scripts/plugins/composer/composer.plugin.zsh
@@ -0,0 +1,29 @@
+# ------------------------------------------------------------------------------
+# FILE: composer.plugin.zsh
+# DESCRIPTION: oh-my-zsh composer plugin file.
+# AUTHOR: Daniel Gomes (me@danielcsgomes.com)
+# VERSION: 1.0.0
+# ------------------------------------------------------------------------------
+
+# Composer basic command completion
+_composer_get_command_list () {
+ composer --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }'
+}
+
+_composer () {
+ if [ -f composer.json ]; then
+ compadd `_composer_get_command_list`
+ fi
+}
+
+compdef _composer composer
+
+# Aliases
+alias c='composer'
+alias csu='composer self-update'
+alias cu='composer update'
+alias ci='composer install'
+alias ccp='composer create-project'
+
+# install composer in the current directory
+alias cget='curl -s https://getcomposer.org/installer | php'
View
14 zsh-scripts/plugins/cp/cp.plugin.zsh
@@ -0,0 +1,14 @@
+#Show progress while file is copying
+
+# Rsync options are:
+# -p - preserve permissions
+# -o - preserve owner
+# -g - preserve group
+# -h - output in human-readable format
+# --progress - display progress
+# -b - instead of just overwriting an existing file, save the original
+# --backup-dir=/tmp/rsync - move backup copies to "/tmp/rsync"
+# -e /dev/null - only work on local files
+# -- - everything after this is an argument, even if it looks like an option
+
+alias cpv="rsync -poghb --backup-dir=/tmp/rsync -e /dev/null --progress --"
View
67 zsh-scripts/plugins/cpanm/_cpanm
@@ -0,0 +1,67 @@
+#compdef cpanm
+
+##
+# cpanminus Z Shell completion script
+##
+#
+# Current supported cpanm version: 1.4000 (Tue Mar 8 01:00:49 PST 2011)
+#
+# The latest code is always located at:
+# https://github.com/rshhh/cpanminus/blob/master/etc/_cpanm
+#
+
+local arguments curcontext="$curcontext"
+typeset -A opt_args
+
+
+arguments=(
+
+# Commands
+# '(--install -i)'{--install,-i}'[Installs the modules]'
+ '(- :)--self-upgrade[Upgrades itself]'
+ '(- :)--info[Displays distribution info on CPAN]'
+ '(--installdeps)--installdeps[Only install dependencies]'
+ '(--look)--look[Download/unpack the distribution and then open the directory with your shell]'
+ '(- :)'{--help,-h}'[Displays help information]'
+ '(- :)'{--version,-V}'[Displays software version]'
+
+# Options
+ {--force,-f}'[Force install]'
+ {--notest,-n}'[Do not run unit tests]'
+ {--sudo,-S}'[sudo to run install commands]'
+ '(-v --verbose --quiet -q)'{--verbose,-v}'[Turns on chatty output]'
+ '(-q --quiet --verbose -v)'{--quiet,-q}'[Turns off all output]'
+ {--local-lib,-l}'[Specify the install base to install modules]'
+ {--local-lib-contained,-L}'[Specify the install base to install all non-core modules]'
+ '--mirror[Specify the base URL for the mirror (e.g. http://cpan.cpantesters.org/)]:URLs:_urls'
+ '--mirror-only[Use the mirror\''s index file instead of the CPAN Meta DB]'
+ '--prompt[Prompt when configure/build/test fails]'
+ '--reinstall[Reinstall the distribution even if you already have the latest version installed]'
+ '--interactive[Turn on interactive configure]'
+
+ '--scandeps[Scan the depencencies of given modules and output the tree in a text format]'
+ '--format[Specify what format to display the scanned dependency tree]:scandeps format:(tree json yaml dists)'
+
+ '--save-dists[Specify the optional directory path to copy downloaded tarballs]'
+# '--uninst-shadows[Uninstalls the shadow files of the distribution that you\''re installing]'
+
+ '--auto-cleanup[Number of days that cpanm\''s work directories expire in. Defaults to 7]'
+ '(--no-man-pages)--man-pages[Generates man pages for executables (man1) and libraries (man3)]'
+ '(--man-pages)--no-man-pages[Do not generate man pages]'
+
+
+ # Note: Normally with "--lwp", "--wget" and "--curl" options set to true (which is the default) cpanm tries LWP,
+ # Wget, cURL and HTTP::Tiny (in that order) and uses the first one available.
+ # (So that the exclusions are not enabled here for the completion)
+ '(--lwp)--lwp[Use LWP module to download stuff]'
+ '(--wget)--wget[Use GNU Wget (if available) to download stuff]'
+ '(--curl)--curl[Use cURL (if available) to download stuff]'
+
+# Other completions
+ '*:Local directory or archive:_files -/ -g "*.(tar.gz|tgz|tar.bz2|zip)(-.)"'
+ # '*::args: _normal' # this looks for default files (any files)
+)
+_arguments -s $arguments \
+ && return 0
+
+return 1
View
186 zsh-scripts/plugins/debian/debian.plugin.zsh
@@ -0,0 +1,186 @@
+# Authors:
+# https://github.com/AlexBio
+# https://github.com/dbb
+#
+# Debian-related zsh aliases and functions for zsh
+
+# Use aptitude if installed, or apt-get if not.
+# You can just set apt_pref='apt-get' to override it.
+if [[ -e $( which aptitude 2>&1 ) ]]; then
+ apt_pref='aptitude'
+else
+ apt_pref='apt-get'
+fi
+
+# Use sudo by default if it's installed
+if [[ -e $( which sudo 2>&1 ) ]]; then
+ use_sudo=1
+fi
+
+# Aliases ###################################################################
+# These are for more obscure uses of apt-get and aptitude that aren't covered
+# below.
+alias ag='apt-get'
+alias ap='aptitude'
+
+# Some self-explanatory aliases
+alias acs="apt-cache search"
+alias aps='aptitude search'
+alias as="aptitude -F \"* %p -> %d \n(%v/%V)\" \
+ --no-gui --disable-columns search" # search package
+
+# apt-file
+alias afs='apt-file search --regexp'
+
+
+# These are apt-get only
+alias asrc='apt-get source'
+alias app='apt-cache policy'
+
+# superuser operations ######################################################
+if [[ $use_sudo -eq 1 ]]; then
+# commands using sudo #######
+ alias aac='sudo $apt_pref autoclean'
+ alias abd='sudo $apt_pref build-dep'
+ alias ac='sudo $apt_pref clean'
+ alias ad='sudo $apt_pref update'
+ alias adg='sudo $apt_pref update && sudo $apt_pref upgrade'
+ alias adu='sudo $apt_pref update && sudo $apt_pref dist-upgrade'
+ alias afu='sudo apt-file update'
+ alias ag='sudo $apt_pref upgrade'
+ alias ai='sudo $apt_pref install'
+ # Install all packages given on the command line while using only the first word of each line:
+ # acs ... | ail
+ alias ail="sed -e 's/ */ /g' -e 's/ *//' | cut -s -d ' ' -f 1 | "' xargs sudo $apt_pref install'
+ alias ap='sudo $apt_pref purge'
+ alias ar='sudo $apt_pref remove'
+
+ # apt-get only
+ alias ads='sudo $apt_pref dselect-upgrade'
+
+ # Install all .deb files in the current directory.
+ # Warning: you will need to put the glob in single quotes if you use:
+ # glob_subst
+ alias dia='sudo dpkg -i ./*.deb'
+ alias di='sudo dpkg -i'
+
+ # Remove ALL kernel images and headers EXCEPT the one in use
+ alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \
+ ?not(~n`uname -r`))'
+
+
+# commands using su #########
+else
+ alias aac='su -ls \'$apt_pref autoclean\' root'
+ abd() {
+ cmd="su -lc '$apt_pref build-dep $@' root"
+ print "$cmd"
+ eval "$cmd"
+ }
+ alias ac='su -ls \'$apt_pref clean\' root'
+ alias ad='su -lc \'$apt_pref update\' root'
+ alias adg='su -lc \'$apt_pref update && aptitude safe-upgrade\' root'
+ alias adu='su -lc \'$apt_pref update && aptitude dist-upgrade\' root'
+ alias afu='su -lc "apt-file update"'
+ alias ag='su -lc \'$apt_pref safe-upgrade\' root'
+ ai() {
+ cmd="su -lc 'aptitude -P install $@' root"
+ print "$cmd"
+ eval "$cmd"
+ }
+ ap() {
+ cmd="su -lc '$apt_pref -P purge $@' root"
+ print "$cmd"
+ eval "$cmd"
+ }
+ ar() {
+ cmd="su -lc '$apt_pref -P remove $@' root"
+ print "$cmd"
+ eval "$cmd"
+ }
+
+ # Install all .deb files in the current directory
+ # Assumes glob_subst is off
+ alias dia='su -lc "dpkg -i ./*.deb" root'
+ alias di='su -lc "dpkg -i" root'
+
+ # Remove ALL kernel images and headers EXCEPT the one in use
+ alias kclean='su -lc '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) \
+ ?not(~n`uname -r`))'\'' root'
+fi
+
+
+# Misc. #####################################################################
+# print all installed packages
+alias allpkgs='aptitude search -F "%p" --disable-columns ~i'
+
+# Create a basic .deb package
+alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc'
+
+
+# Functions #################################################################
+# create a simple script that can be used to 'duplicate' a system
+apt-copy() {
+ print '#!/bin/sh'"\n" > apt-copy.sh
+
+ cmd='$apt_pref install'
+
+ for p in ${(f)"$(aptitude search -F "%p" --disable-columns \~i)"}; {
+ cmd="${cmd} ${p}"
+ }
+
+ print $cmd "\n" >> apt-copy.sh
+
+ chmod +x apt-copy.sh
+}
+
+# Prints apt history
+# Usage:
+# apt-history install
+# apt-history upgrade
+# apt-history remove
+# apt-history rollback
+# apt-history list
+# Based On: http://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html
+apt-history () {
+ case "$1" in
+ install)
+ zgrep --no-filename 'install ' $(ls -rt /var/log/dpkg*)
+ ;;
+ upgrade|remove)
+ zgrep --no-filename $1 $(ls -rt /var/log/dpkg*)
+ ;;
+ rollback)
+ zgrep --no-filename upgrade $(ls -rt /var/log/dpkg*) | \
+ grep "$2" -A10000000 | \
+ grep "$3" -B10000000 | \
+ awk '{print $4"="$5}'
+ ;;
+ list)
+ zcat $(ls -rt /var/log/dpkg*)
+ ;;
+ *)
+ echo "Parameters:"
+ echo " install - Lists all packages that have been installed."
+ echo " upgrade - Lists all packages that have been upgraded."
+ echo " remove - Lists all packages that have been removed."
+ echo " rollback - Lists rollback information."
+ echo " list - Lists all contains of dpkg logs."
+ ;;
+ esac
+}
+
+# Kernel-package building shortcut
+kerndeb () {
+ # temporarily unset MAKEFLAGS ( '-j3' will fail )
+ MAKEFLAGS=$( print - $MAKEFLAGS | perl -pe 's/-j\s*[\d]+//g' )
+ print '$MAKEFLAGS set to '"'$MAKEFLAGS'"
+ appendage='-custom' # this shows up in $ (uname -r )
+ revision=$(date +"%Y%m%d") # this shows up in the .deb file name
+
+ make-kpkg clean
+
+ time fakeroot make-kpkg --append-to-version "$appendage" --revision \
+ "$revision" kernel_image kernel_headers
+}
+
View
10 zsh-scripts/plugins/dircycle/dircycle.plugin.zsh
@@ -0,0 +1,10 @@
+##
+# dircycle plugin: enables cycling through the directory
+# stack using Ctrl+Shift+Left/Right
+
+eval "insert-cycledleft () { zle push-line; LBUFFER='pushd -q +1'; zle accept-line }"
+zle -N insert-cycledleft
+bindkey "\e[1;6D" insert-cycledleft
+eval "insert-cycledright () { zle push-line; LBUFFER='pushd -q -0'; zle accept-line }"
+zle -N insert-cycledright
+bindkey "\e[1;6C" insert-cycledright
View
39 zsh-scripts/plugins/dirpersist/dirpersist.plugin.zsh
@@ -0,0 +1,39 @@
+#!/bin/zsh
+#
+# Make the dirstack more persistant
+#
+# Add dirpersist to $plugins in ~/.zshrc to load
+#
+
+# $zdirstore is the file used to persist the stack
+zdirstore=~/.zdirstore
+
+dirpersistinstall () {
+ if grep 'dirpersiststore' ~/.zlogout > /dev/null; then
+ else
+ if read -q \?"Would you like to set up your .zlogout file for use with dirspersist? (y/n) "; then
+ echo "# Store dirs stack\n# See $ZSH/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout
+ else
+ echo "If you don't want this message to appear, remove dirspersist from \$plugins"
+ fi
+ fi
+}
+
+dirpersiststore () {
+ dirs -p | perl -e 'foreach (reverse <STDIN>) {chomp;s/([& ])/\\$1/g ;print "if [ -d $_ ]; then pushd -q $_; fi\n"}' > $zdirstore
+}
+
+dirpersistrestore () {
+ if [ -f $zdirstore ]; then
+ source $zdirstore
+ fi
+}
+
+DIRSTACKSIZE=10
+setopt autopushd pushdminus pushdsilent pushdtohome pushdignoredups
+
+dirpersistinstall
+dirpersistrestore
+
+# Make popd changes permanent without having to wait for logout
+alias popd="popd;dirpersiststore"
View
223 zsh-scripts/plugins/django/django.plugin.zsh
@@ -0,0 +1,223 @@
+#compdef manage.py
+
+typeset -ga nul_args
+nul_args=(
+ '--settings=-[the Python path to a settings module.]:file:_files'
+ '--pythonpath=-[a directory to add to the Python path.]::directory:_directories'
+ '--traceback[print traceback on exception.]'
+ "--version[show program's version number and exit.]"
+ {-h,--help}'[show this help message and exit.]'
+)
+
+_managepy-adminindex(){
+ _arguments -s : \
+ $nul_args \
+ '*::directory:_directories' && ret=0
+}
+
+_managepy-createcachetable(){
+ _arguments -s : \
+ $nul_args && ret=0
+}
+
+_managepy-dbshell(){
+ _arguments -s : \
+ $nul_args && ret=0
+}
+
+_managepy-diffsettings(){
+ _arguments -s : \
+ $nul_args && ret=0
+}
+
+_managepy-dumpdata(){
+ _arguments -s : \
+ '--format=-[specifies the output serialization format for fixtures.]:format:(json yaml xml)' \
+ '--indent=-[specifies the indent level to use when pretty-printing output.]:' \
+ $nul_args \
+ '*::appname:_applist' && ret=0
+}
+
+_managepy-flush(){
+ _arguments -s : \
+ '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
+ '--noinput[tells Django to NOT prompt the user for input of any kind.]' \
+ $nul_args && ret=0
+}
+
+_managepy-help(){
+ _arguments -s : \
+ '*:command:_managepy_cmds' \
+ $nul_args && ret=0
+}
+
+_managepy_cmds(){
+ local line
+ local -a cmd
+ _call_program help-command ./manage.py help \
+ |& sed -n '/^ /s/[(), ]/ /gp' \
+ | while read -A line; do cmd=($line $cmd) done
+ _describe -t managepy-command 'manage.py command' cmd
+}
+
+_managepy-inspectdb(){
+ _arguments -s : \
+ $nul_args && ret=0
+}
+
+_managepy-loaddata(){
+ _arguments -s : \
+ '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
+ '*::file:_files' \
+ $nul_args && ret=0
+}
+
+_managepy-reset(){
+ _arguments -s : \
+ '--noinput[tells Django to NOT prompt the user for input of any kind.]' \
+ '*::appname:_applist' \
+ $nul_args && ret=0
+}
+
+_managepy-runfcgi(){
+ local state
+
+ local fcgi_opts
+ fcgi_opts=(
+ 'protocol[fcgi, scgi, ajp, ... (default fcgi)]:protocol:(fcgi scgi ajp)'
+ 'host[hostname to listen on..]:'
+ 'port[port to listen on.]:'
+ 'socket[UNIX socket to listen on.]::file:_files'
+ 'method[prefork or threaded (default prefork)]:method:(prefork threaded)'
+ 'maxrequests[number of requests a child handles before it is killed and a new child is forked (0 = no limit).]:'
+ 'maxspare[max number of spare processes / threads.]:'
+ 'minspare[min number of spare processes / threads.]:'
+ 'maxchildren[hard limit number of processes / threads.]:'
+ 'daemonize[whether to detach from terminal.]:boolean:(False True)'
+ 'pidfile[write the spawned process-id to this file.]:file:_files'
+ 'workdir[change to this directory when daemonizing.]:directory:_files'
+ 'outlog[write stdout to this file.]:file:_files'
+ 'errlog[write stderr to this file.]:file:_files'
+ )
+
+ _arguments -s : \
+ $nul_args \
+ '*: :_values "FCGI Setting" $fcgi_opts' && ret=0
+}
+
+_managepy-runserver(){
+ _arguments -s : \
+ '--noreload[tells Django to NOT use the auto-reloader.]' \
+ '--adminmedia[specifies the directory from which to serve admin media.]:directory:_files' \
+ $nul_args && ret=0
+}
+
+_managepy-shell(){
+ _arguments -s : \
+ '--plain[tells Django to use plain Python, not IPython.]' \
+ $nul_args && ret=0
+}
+
+_managepy-sql(){}
+_managepy-sqlall(){}
+_managepy-sqlclear(){}
+_managepy-sqlcustom(){}
+_managepy-sqlflush(){}
+_managepy-sqlindexes(){}
+_managepy-sqlinitialdata(){}
+_managepy-sqlreset(){}
+_managepy-sqlsequencereset(){}
+_managepy-startapp(){}
+
+_managepy-syncdb() {
+ _arguments -s : \
+ '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
+ '--noinput[tells Django to NOT prompt the user for input of any kind.]' \
+ $nul_args && ret=0
+}
+
+_managepy-test() {
+ _arguments -s : \
+ '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
+ '--noinput[tells Django to NOT prompt the user for input of any kind.]' \
+ '*::appname:_applist' \
+ $nul_args && ret=0
+}
+
+_managepy-testserver() {
+ _arguments -s : \
+ '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
+ '--addrport=-[port number or ipaddr:port to run the server on.]' \
+ '*::fixture:_files' \
+ $nul_args && ret=0
+}
+
+_managepy-validate() {
+ _arguments -s : \
+ $nul_args && ret=0
+}
+
+_managepy-commands() {
+ local -a commands
+
+ commands=(
+ 'adminindex:prints the admin-index template snippet for the given app name(s).'
+ 'createcachetable:creates the table needed to use the SQL cache backend.'
+ 'dbshell:runs the command-line client for the current DATABASE_ENGINE.'
+ "diffsettings:displays differences between the current settings.py and Django's default settings."
+ 'dumpdata:Output the contents of the database as a fixture of the given format.'
+ 'flush:Executes ``sqlflush`` on the current database.'
+ 'help:manage.py help.'
+ 'inspectdb:Introspects the database tables in the given database and outputs a Django model module.'
+ 'loaddata:Installs the named fixture(s) in the database.'
+ 'reset:Executes ``sqlreset`` for the given app(s) in the current database.'
+ 'runfcgi:Run this project as a fastcgi (or some other protocol supported by flup) application,'
+ 'runserver:Starts a lightweight Web server for development.'
+ 'shell:Runs a Python interactive interpreter.'
+ 'sql:Prints the CREATE TABLE SQL statements for the given app name(s).'
+ 'sqlall:Prints the CREATE TABLE, custom SQL and CREATE INDEX SQL statements for the given model module name(s).'
+ 'sqlclear:Prints the DROP TABLE SQL statements for the given app name(s).'
+ 'sqlcustom:Prints the custom table modifying SQL statements for the given app name(s).'
+ 'sqlflush:Returns a list of the SQL statements required to return all tables in the database to the state they were in just after they were installed.'
+ 'sqlindexes:Prints the CREATE INDEX SQL statements for the given model module name(s).'
+ "sqlinitialdata:RENAMED: see 'sqlcustom'"
+ 'sqlreset:Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app name(s).'
+ 'sqlsequencereset:Prints the SQL statements for resetting sequences for the given app name(s).'
+ "startapp:Creates a Django app directory structure for the given app name in this project's directory."
+ "syncdb:Create the database tables for all apps in INSTALLED_APPS whose tables haven't already been created."
+ 'test:Runs the test suite for the specified applications, or the entire site if no apps are specified.'
+ 'testserver:Runs a development server with data from the given fixture(s).'
+ 'validate:Validates all installed models.'
+ )
+
+ _describe -t commands 'manage.py command' commands && ret=0
+}
+
+_applist() {
+ local line
+ local -a apps
+ _call_program help-command "python -c \"import os.path as op, re, django.conf, sys;\\
+ bn=op.basename(op.abspath(op.curdir));[sys\\
+ .stdout.write(str(re.sub(r'^%s\.(.*?)$' %
+ bn, r'\1', i)) + '\n') for i in django.conf.settings.\\
+ INSTALLED_APPS if re.match(r'^%s' % bn, i)]\"" \
+ | while read -A line; do apps=($line $apps) done
+ _values 'Application' $apps && ret=0
+}
+
+_managepy() {
+ local curcontext=$curcontext ret=1
+
+ if ((CURRENT == 2)); then
+ _managepy-commands
+ else
+ shift words
+ (( CURRENT -- ))
+ curcontext="${curcontext%:*:*}:managepy-$words[1]:"
+ _call_function ret _managepy-$words[1]
+ fi
+}
+
+compdef _managepy manage.py
+compdef _managepy django
+compdef _managepy django-manage
View
2  zsh-scripts/plugins/encode64/encode64.plugin.zsh
@@ -0,0 +1,2 @@
+encode64(){ echo -n $1 | base64 }
+decode64(){ echo -n $1 | base64 -D }
View
8 zsh-scripts/plugins/extract/_extract
@@ -0,0 +1,8 @@
+#compdef extract
+#autoload
+
+_arguments \
+ '(-r --remove)'{-r,--remove}'[Remove archive.]' \
+ "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z|deb)(-.)'" && return 0
+
+
View
80 zsh-scripts/plugins/extract/extract.plugin.zsh
@@ -0,0 +1,80 @@
+# ------------------------------------------------------------------------------
+# FILE: extract.plugin.zsh
+# DESCRIPTION: oh-my-zsh plugin file.
+# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com)
+# VERSION: 1.0.1
+# ------------------------------------------------------------------------------
+
+
+function extract() {
+ local remove_archive
+ local success
+ local file_name
+ local extract_dir
+
+ if (( $# == 0 )); then
+ echo "Usage: extract [-option] [file ...]"
+ echo
+ echo Options:
+ echo " -r, --remove Remove archive."
+ echo
+ echo "Report bugs to <sorin.ionescu@gmail.com>."
+ fi
+
+ remove_archive=1
+ if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then
+ remove_archive=0
+ shift
+ fi
+
+ while (( $# > 0 )); do
+ if [[ ! -f "$1" ]]; then
+ echo "extract: '$1' is not a valid file" 1>&2
+ shift
+ continue
+ fi
+
+ success=0
+ file_name="$( basename "$1" )"
+ extract_dir="$( echo "$file_name" | sed "s/\.${1##*.}//g" )"
+ case "$1" in
+ (*.tar.gz|*.tgz) tar xvzf "$1" ;;
+ (*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;;
+ (*.tar.xz|*.txz) tar --xz --help &> /dev/null \
+ && tar --xz -xvf "$1" \
+ || xzcat "$1" | tar xvf - ;;
+ (*.tar.zma|*.tlz) tar --lzma --help &> /dev/null \
+ && tar --lzma -xvf "$1" \
+ || lzcat "$1" | tar xvf - ;;
+ (*.tar) tar xvf "$1" ;;
+ (*.gz) gunzip "$1" ;;
+ (*.bz2) bunzip2 "$1" ;;
+ (*.xz) unxz "$1" ;;
+ (*.lzma) unlzma "$1" ;;
+ (*.Z) uncompress "$1" ;;
+ (*.zip) unzip "$1" -d $extract_dir ;;
+ (*.rar) unrar e -ad "$1" ;;
+ (*.7z) 7za x "$1" ;;
+ (*.deb)
+ mkdir -p "$extract_dir/control"
+ mkdir -p "$extract_dir/data"
+ cd "$extract_dir"; ar vx "../${1}" > /dev/null
+ cd control; tar xzvf ../control.tar.gz
+ cd ../data; tar xzvf ../data.tar.gz
+ cd ..; rm *.tar.gz debian-binary
+ cd ..
+ ;;
+ (*)
+ echo "extract: '$1' cannot be extracted" 1>&2
+ success=1
+ ;;
+ esac
+
+ (( success = $success > 0 ? $success : $? ))
+ (( $success == 0 )) && (( $remove_archive == 0 )) && rm "$1"
+ shift
+ done
+}
+
+alias x=extract
+
View
6 zsh-scripts/plugins/fasd/fasd.plugin.zsh
@@ -0,0 +1,6 @@
+if [ $commands[fasd] ]; then # check if fasd is installed
+ eval "$(fasd --init auto)"
+ alias v='f -e vim'
+ alias o='a -e open'
+fi
+
View
44 zsh-scripts/plugins/forklift/forklift.plugin.zsh
@@ -0,0 +1,44 @@
+# Open folder in ForkLift.app from console
+# Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de
+#
+# Usage:
+# fl [<folder>]
+#
+# Opens specified directory or current working directory in ForkLift.app
+#
+# Notes:
+# It assumes Shift+Cmd+G launches go to folder panel and Cmd+N opens new
+# app window.
+#
+# https://gist.github.com/3313481
+function fl {
+ if [ ! -z "$1" ]; then
+ DIR=$1
+ if [ ! -d "$DIR" ]; then
+ DIR=$(dirname $DIR)
+ fi
+ if [ "$DIR" != "." ]; then
+ PWD=`cd "$DIR";pwd`
+ fi
+ fi
+ osascript 2>&1 1>/dev/null <<END
+ tell application "ForkLift"
+ activate
+ end tell
+ tell application "System Events"
+ tell application process "ForkLift"
+ try
+ set topWindow to window 1
+ on error
+ keystroke "n" using command down
+ set topWindow to window 1
+ end try
+ keystroke "g" using {command down, shift down}
+ tell sheet 1 of topWindow
+ set value of text field 1 to "$PWD"
+ keystroke return
+ end tell
+ end tell
+ end tell
+END
+}
View
34 zsh-scripts/plugins/gas/_gas
@@ -0,0 +1,34 @@
+#compdef gas
+
+local curcontext="$curcontext" state line cmds ret=1
+
+_arguments -C \
+ '(- 1 *)'{-v,--version}'[display version information]' \
+ '(-h|--help)'{-h,--help}'[show help information]' \
+ '1: :->cmds' \
+ '*: :->args' && ret=0
+
+case $state in
+ cmds)
+ cmds=(
+ "version:Prints Gas's version"
+ "use:Uses author"
+ "show:Shows your current user"
+ "list:Lists your authors"
+ "import:Imports current user to gasconfig"
+ "help:Describe available tasks or one specific task"
+ "delete:Deletes author"
+ "add:Adds author to gasconfig"
+ )
+ _describe -t commands 'gas command' cmds && ret=0
+ ;;
+ args)
+ case $line[1] in
+ (use|delete)
+ _values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0
+ ;;
+ esac
+ ;;
+esac
+
+return ret
View
64 zsh-scripts/plugins/gem/_gem
@@ -0,0 +1,64 @@
+#compdef gem
+#autoload
+
+# gem zsh completion, based on homebrew completion
+
+_gem_installed() {
+ installed_gems=(`gem list --local --no-versions`)
+}
+
+local -a _1st_arguments
+_1st_arguments=(
+ 'cert:Manage RubyGems certificates and signing settings'
+ 'check:Check installed gems'
+ 'cleanup:Clean up old versions of installed gems in the local repository'
+ 'contents:Display the contents of the installed gems'
+ 'dependency:Show the dependencies of an installed gem'
+ 'environment:Display information about the RubyGems environment'
+ 'fetch:Download a gem and place it in the current directory'
+ 'generate_index:Generates the index files for a gem server directory'
+ 'help:Provide help on the `gem` command'
+ 'install:Install a gem into the local repository'
+ 'list:Display gems whose name starts with STRING'
+ 'lock:Generate a lockdown list of gems'
+ 'mirror:Mirror a gem repository'
+ 'outdated:Display all gems that need updates'
+ 'owner:Manage gem owners on RubyGems.org.'
+ 'pristine:Restores installed gems to pristine condition from files located in the gem cache'
+ 'push:Push a gem up to RubyGems.org'
+ 'query:Query gem information in local or remote repositories'
+ 'rdoc:Generates RDoc for pre-installed gems'
+ 'search:Display all gems whose name contains STRING'
+ 'server:Documentation and gem repository HTTP server'
+ 'sources:Manage the sources and cache file RubyGems uses to search for gems'
+ 'specification:Display gem specification (in yaml)'
+ 'stale:List gems along with access times'
+ 'uninstall:Uninstall gems from the local repository'
+ 'unpack:Unpack an installed gem to the current directory'
+ 'update:Update the named gems (or all installed gems) in the local repository'
+ 'which:Find the location of a library file you can require'
+)
+
+local expl
+local -a gems installed_gems
+
+_arguments \
+ '(-v --version)'{-v,--version}'[show version]' \
+ '(-h --help)'{-h,--help}'[show help]' \
+ '*:: :->subcmds' && return 0
+
+if (( CURRENT == 1 )); then
+ _describe -t commands "gem subcommand" _1st_arguments
+ return
+fi
+
+case "$words[1]" in
+ list)
+ if [[ "$state" == forms ]]; then
+ _gem_installed
+ _requested installed_gems expl 'installed gems' compadd -a installed_gems
+ fi ;;
+ uninstall|update)
+ _gem_installed
+ _wanted installed_gems expl 'installed gems' compadd -a installed_gems ;;
+esac
View
285 zsh-scripts/plugins/git-extras/git-extras.plugin.zsh
@@ -0,0 +1,285 @@
+#compdef git
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for git-extras (http://github.com/visionmedia/git-extras).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Alexis GRIMALDI (https://github.com/agrimaldi)
+#
+# ------------------------------------------------------------------------------
+# Inspirations
+# -----------
+#
+# * git-extras (http://github.com/visionmedia/git-extras)
+# * git-flow-completion (http://github.com/bobthecow/git-flow-completion)
+#
+# ------------------------------------------------------------------------------
+
+
+__git_command_successful () {