8a102b941f80050a82b26b1e8ac79ffa4cc3a855
- Author
- Robby Russell <robby@planetargon.com>
- Committer
- Robby Russell <robby@planetargon.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/.gitignore b/.gitignore
2index 8fdfae28646a98adc039755bd9bed94b628e7eea..2e8db7341894fdf0940c0c37995e93e1b3b0d9fa 100644
3--- a/.gitignore
4+++ b/.gitignore
5@@ -5,3 +5,4 @@ custom/*
6 !custom/example
7 !custom/example.zsh
8 cache
9+*.swp
10diff --git a/lib/edit-command-line.zsh b/lib/edit-command-line.zsh
11new file mode 100644
12index 0000000000000000000000000000000000000000..db2000325c82691b5eef2b664c27b00caab1ec58
13--- /dev/null
14+++ b/lib/edit-command-line.zsh
15@@ -0,0 +1,3 @@
16+autoload -U edit-command-line
17+zle -N edit-command-line
18+bindkey '\C-x\C-e' edit-command-line
19diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
20new file mode 100644
21index 0000000000000000000000000000000000000000..8ed291fcf04b6d1a2f250de810a58cc2d8783cde
22--- /dev/null
23+++ b/plugins/archlinux/archlinux.plugin.zsh
24@@ -0,0 +1,68 @@
25+# Archlinux zsh aliases and functions for zsh
26+
27+# Aliases ###################################################################
28+
29+# Look for yaourt, and add some useful functions if we have it.
30+if [[ -x `which yaourt` ]]; then
31+ upgrade () {
32+ yaourt -Syu -C
33+ }
34+ # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
35+ alias yaupg='sudo yaourt -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system.
36+ alias yain='sudo yaourt -S' # Install specific package(s) from the repositories
37+ alias yains='sudo yaourt -U' # Install specific package not from the repositories but from a file
38+ alias yare='sudo yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies
39+ alias yarem='sudo yaourt -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies
40+ alias yarep='yaourt -Si' # Display information about a given package in the repositories
41+ alias yareps='yaourt -Ss' # Search for package(s) in the repositories
42+ alias yaloc='yaourt -Qi' # Display information about a given package in the local database
43+ alias yalocs='yaourt -Qs' # Search for package(s) in the local database
44+ # Additional yaourt alias examples
45+ alias yaupd='sudo yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
46+ alias yainsd='sudo yaourt -S --asdeps' # Install given package(s) as dependencies of another package
47+ alias yamir='sudo yaourt -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
48+else
49+ upgrade() {
50+ sudo pacman -Syu
51+ }
52+fi
53+
54+# Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
55+alias pacupg='sudo pacman -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system.
56+alias pacin='sudo pacman -S' # Install specific package(s) from the repositories
57+alias pacins='sudo pacman -U' # Install specific package not from the repositories but from a file
58+alias pacre='sudo pacman -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies
59+alias pacrem='sudo pacman -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies
60+alias pacrep='pacman -Si' # Display information about a given package in the repositories
61+alias pacreps='pacman -Ss' # Search for package(s) in the repositories
62+alias pacloc='pacman -Qi' # Display information about a given package in the local database
63+alias paclocs='pacman -Qs' # Search for package(s) in the local database
64+# Additional pacman alias examples
65+alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
66+alias pacinsd='sudo pacman -S --asdeps' # Install given package(s) as dependencies of another package
67+alias pacmir='sudo pacman -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
68+
69+# https://bbs.archlinux.org/viewtopic.php?id=93683
70+paclist() {
71+ 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}'
72+}
73+
74+alias paclsorphans='sudo pacman -Qdt'
75+alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)'
76+
77+pacdisowned() {
78+ tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$
79+ db=$tmp/db
80+ fs=$tmp/fs
81+
82+ mkdir "$tmp"
83+ trap 'rm -rf "$tmp"' EXIT
84+
85+ pacman -Qlq | sort -u > "$db"
86+
87+ find /bin /etc /lib /sbin /usr \
88+ ! -name lost+found \
89+ \( -type d -printf '%p/\n' -o -print \) | sort > "$fs"
90+
91+ comm -23 "$fs" "$db"
92+}
93diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
94index fb40e2cec10dc79da5875c660d18d70d4ee9ac10..e98bb4b46363379ff658da4c7590081aeaf7fdcd 100644
95--- a/plugins/bundler/bundler.plugin.zsh
96+++ b/plugins/bundler/bundler.plugin.zsh
97@@ -1,3 +1,36 @@
98 alias be="bundle exec"
99 alias bi="bundle install"
100+alias bl="bundle list"
101 alias bu="bundle update"
102+
103+# The following is based on https://github.com/gma/bundler-exec
104+
105+bundled_commands=(cap capify cucumber heroku rackup rails rake rspec ruby shotgun spec spork thin unicorn unicorn_rails)
106+
107+## Functions
108+
109+_bundler-installed() {
110+ which bundle > /dev/null 2>&1
111+}
112+
113+_within-bundled-project() {
114+ local check_dir=$PWD
115+ while [ "$(dirname $check_dir)" != "/" ]; do
116+ [ -f "$check_dir/Gemfile" ] && return
117+ check_dir="$(dirname $check_dir)"
118+ done
119+ false
120+}
121+
122+_run-with-bundler() {
123+ if _bundler-installed && _within-bundled-project; then
124+ bundle exec $@
125+ else
126+ $@
127+ fi
128+}
129+
130+## Main program
131+for cmd in $bundled_commands; do
132+ alias $cmd="_run-with-bundler $cmd"
133+done
134diff --git a/plugins/cake/cake.plugin.zsh b/plugins/cake/cake.plugin.zsh
135new file mode 100644
136index 0000000000000000000000000000000000000000..f968c71d582a35a9e175f0fc3a55d220f71d85fe
137--- /dev/null
138+++ b/plugins/cake/cake.plugin.zsh
139@@ -0,0 +1,32 @@
140+# Set this to 1 if you want to cache the tasks
141+cache_task_list=1
142+
143+# Cache filename
144+cache_file='.cake_task_cache'
145+
146+_cake_does_target_list_need_generating () {
147+
148+ if [ $cache_task_list -eq 0 ]; then
149+ return 1;
150+ fi
151+
152+ if [ ! -f $cache_file ]; then return 0;
153+ else
154+ accurate=$(stat -f%m $cache_file)
155+ changed=$(stat -f%m Cakefile)
156+ return $(expr $accurate '>=' $changed)
157+ fi
158+}
159+
160+_cake () {
161+ if [ -f Cakefile ]; then
162+ if _cake_does_target_list_need_generating; then
163+ cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$' > $cache_file
164+ compadd `cat $cache_file`
165+ else
166+ compadd `cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$'`
167+ fi
168+ fi
169+}
170+
171+compdef _cake cake
172diff --git a/plugins/cloudapp/cloudapp.plugin.zsh b/plugins/cloudapp/cloudapp.plugin.zsh
173new file mode 100644
174index 0000000000000000000000000000000000000000..99252f690b13c0d247024187858c759898d9474f
175--- /dev/null
176+++ b/plugins/cloudapp/cloudapp.plugin.zsh
177@@ -0,0 +1,2 @@
178+#!/bin/zsh
179+alias cloudapp=$ZSH/plugins/cloudapp/cloudapp.rb
180diff --git a/plugins/cloudapp/cloudapp.rb b/plugins/cloudapp/cloudapp.rb
181new file mode 100755
182index 0000000000000000000000000000000000000000..a11cfdb32be06a1fb1ea00933f306e2ff1e95715
183--- /dev/null
184+++ b/plugins/cloudapp/cloudapp.rb
185@@ -0,0 +1,60 @@
186+#!/usr/bin/env ruby
187+#
188+# cloudapp
189+# Zach Holman / @holman
190+#
191+# Uploads a file from the command line to CloudApp, drops it into your
192+# clipboard (on a Mac, at least).
193+#
194+# Example:
195+#
196+# cloudapp drunk-blake.png
197+#
198+# This requires Aaron Russell's cloudapp_api gem:
199+#
200+# gem install cloudapp_api
201+#
202+# Requires you set your CloudApp credentials in ~/.cloudapp as a simple file of:
203+#
204+# email
205+# password
206+
207+require 'rubygems'
208+begin
209+ require 'cloudapp_api'
210+rescue LoadError
211+ puts "You need to install cloudapp_api: gem install cloudapp_api"
212+ exit!(1)
213+end
214+
215+config_file = "#{ENV['HOME']}/.cloudapp"
216+unless File.exist?(config_file)
217+ puts "You need to type your email and password (one per line) into "+
218+ "`~/.cloudapp`"
219+ exit!(1)
220+end
221+
222+email,password = File.read(config_file).split("\n")
223+
224+class HTTParty::Response
225+ # Apparently HTTPOK.ok? IS NOT OKAY WTFFFFFFFFFFUUUUUUUUUUUUUU
226+ # LETS MONKEY PATCH IT I FEEL OKAY ABOUT IT
227+ def ok? ; true end
228+end
229+
230+if ARGV[0].nil?
231+ puts "You need to specify a file to upload."
232+ exit!(1)
233+end
234+
235+CloudApp.authenticate(email,password)
236+url = CloudApp::Item.create(:upload, {:file => ARGV[0]}).url
237+
238+# Say it for good measure.
239+puts "Uploaded to #{url}."
240+
241+# Get the embed link.
242+url = "#{url}/#{ARGV[0].split('/').last}"
243+
244+# Copy it to your (Mac's) clipboard.
245+`echo '#{url}' | tr -d "\n" | pbcopy`
246diff --git a/plugins/django/django.plugin.zsh b/plugins/django/django.plugin.zsh
247new file mode 100644
248index 0000000000000000000000000000000000000000..1d72a2f2c13f20d33ee63f5ec9918621bdb6827a
249--- /dev/null
250+++ b/plugins/django/django.plugin.zsh
251@@ -0,0 +1,222 @@
252+#compdef manage.py
253+
254+typeset -ga nul_args
255+nul_args=(
256+ '--settings=-[the Python path to a settings module.]:file:_files'
257+ '--pythonpath=-[a directory to add to the Python path.]::directory:_directories'
258+ '--traceback[print traceback on exception.]'
259+ "--version[show program's version number and exit.]"
260+ {-h,--help}'[show this help message and exit.]'
261+)
262+
263+_managepy-adminindex(){
264+ _arguments -s : \
265+ $nul_args \
266+ '*::directory:_directories' && ret=0
267+}
268+
269+_managepy-createcachetable(){
270+ _arguments -s : \
271+ $nul_args && ret=0
272+}
273+
274+_managepy-dbshell(){
275+ _arguments -s : \
276+ $nul_args && ret=0
277+}
278+
279+_managepy-diffsettings(){
280+ _arguments -s : \
281+ $nul_args && ret=0
282+}
283+
284+_managepy-dumpdata(){
285+ _arguments -s : \
286+ '--format=-[specifies the output serialization format for fixtures.]:format:(json yaml xml)' \
287+ '--indent=-[specifies the indent level to use when pretty-printing output.]:' \
288+ $nul_args \
289+ '*::appname:_applist' && ret=0
290+}
291+
292+_managepy-flush(){
293+ _arguments -s : \
294+ '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
295+ '--noinput[tells Django to NOT prompt the user for input of any kind.]' \
296+ $nul_args && ret=0
297+}
298+
299+_managepy-help(){
300+ _arguments -s : \
301+ '*:command:_managepy_cmds' \
302+ $nul_args && ret=0
303+}
304+
305+_managepy_cmds(){
306+ local line
307+ local -a cmd
308+ _call_program help-command ./manage.py help \
309+ |& sed -n '/^ /s/[(), ]/ /gp' \
310+ | while read -A line; do cmd=($line $cmd) done
311+ _describe -t managepy-command 'manage.py command' cmd
312+}
313+
314+_managepy-inspectdb(){
315+ _arguments -s : \
316+ $nul_args && ret=0
317+}
318+
319+_managepy-loaddata(){
320+ _arguments -s : \
321+ '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
322+ '*::file:_files' \
323+ $nul_args && ret=0
324+}
325+
326+_managepy-reset(){
327+ _arguments -s : \
328+ '--noinput[tells Django to NOT prompt the user for input of any kind.]' \
329+ '*::appname:_applist' \
330+ $nul_args && ret=0
331+}
332+
333+_managepy-runfcgi(){
334+ local state
335+
336+ local fcgi_opts
337+ fcgi_opts=(
338+ 'protocol[fcgi, scgi, ajp, ... (default fcgi)]:protocol:(fcgi scgi ajp)'
339+ 'host[hostname to listen on..]:'
340+ 'port[port to listen on.]:'
341+ 'socket[UNIX socket to listen on.]::file:_files'
342+ 'method[prefork or threaded (default prefork)]:method:(prefork threaded)'
343+ 'maxrequests[number of requests a child handles before it is killed and a new child is forked (0 = no limit).]:'
344+ 'maxspare[max number of spare processes / threads.]:'
345+ 'minspare[min number of spare processes / threads.]:'
346+ 'maxchildren[hard limit number of processes / threads.]:'
347+ 'daemonize[whether to detach from terminal.]:boolean:(False True)'
348+ 'pidfile[write the spawned process-id to this file.]:file:_files'
349+ 'workdir[change to this directory when daemonizing.]:directory:_files'
350+ 'outlog[write stdout to this file.]:file:_files'
351diff --git a/plugins/knife/_knife b/plugins/knife/_knife
352new file mode 100644
353index 0000000000000000000000000000000000000000..7f8c95ee5a470810785cb719828371a5e7463e6c
354--- /dev/null
355+++ b/plugins/knife/_knife
356@@ -0,0 +1,174 @@
357+#compdef knife
358+
359+# These flags should be available everywhere according to man knife
360+knife_general_flags=( --help --server-url --key --config --editor --format --log_level --logfile --no-editor --user --print-after --version --yes )
361+
362+# knife has a very special syntax, some example calls are:
363+# knife status
364+# knife cookbook list
365+# knife role show ROLENAME
366+# knife data bag show DATABAGNAME
367+# knife role show ROLENAME --attribute ATTRIBUTENAME
368+# knife cookbook show COOKBOOKNAME COOKBOOKVERSION recipes
369+
370+# The -Q switch in compadd allow for completions of things like "data bag" without having to go through two rounds of completion and avoids zsh inserting a \ for escaping spaces
371+_knife() {
372+ local curcontext="$curcontext" state line
373+ typeset -A opt_args
374+ cloudproviders=(bluebox ec2 rackspace slicehost terremark)
375+ _arguments \
376+ '1: :->knifecmd'\
377+ '2: :->knifesubcmd'\
378+ '3: :->knifesubcmd2' \
379+ '4: :->knifesubcmd3' \
380+ '5: :->knifesubcmd4' \
381+ '6: :->knifesubcmd5'
382+
383+ case $state in
384+ knifecmd)
385+ compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec index node recipe role search ssh status windows $cloudproviders
386+ ;;
387+ knifesubcmd)
388+ case $words[2] in
389+ (bluebox|ec2|rackspace|slicehost|terremark)
390+ compadd "$@" server images
391+ ;;
392+ client)
393+ compadd -Q "$@" "bulk delete" list create show delete edit reregister
394+ ;;
395+ configure)
396+ compadd "$@" client
397+ ;;
398+ cookbook)
399+ compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload
400+ ;;
401+ node)
402+ compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete"
403+ ;;
404+ recipe)
405+ compadd "$@" list
406+ ;;
407+ role)
408+ compadd -Q "$@" "bulk delete" create delete edit "from file" list show
409+ ;;
410+ windows)
411+ compadd "$@" bootstrap
412+ ;;
413+ *)
414+ _arguments '2:Subsubcommands:($(_knife_options1))'
415+ esac
416+ ;;
417+ knifesubcmd2)
418+ case $words[3] in
419+ server)
420+ compadd "$@" list create delete
421+ ;;
422+ images)
423+ compadd "$@" list
424+ ;;
425+ site)
426+ compadd "$@" vendor show share search download list unshare
427+ ;;
428+ (show|delete|edit)
429+ _arguments '3:Subsubcommands:($(_chef_$words[2]s_remote))'
430+ ;;
431+ (upload|test)
432+ _arguments '3:Subsubcommands:($(_chef_$words[2]s_local) --all)'
433+ ;;
434+ list)
435+ compadd -a "$@" knife_general_flags
436+ ;;
437+ bag)
438+ compadd -Q "$@" show edit list "from file" create delete
439+ ;;
440+ *)
441+ _arguments '3:Subsubcommands:($(_knife_options2))'
442+ esac
443+ ;;
444+ knifesubcmd3)
445+ case $words[3] in
446+ show)
447+ case $words[2] in
448+ cookbook)
449+ versioncomp=1
450+ _arguments '4:Cookbookversions:($(_cookbook_versions) latest)'
451+ ;;
452+ (node|client|role)
453+ compadd "$@" --attribute
454+ esac
455+ esac
456diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh
457index f669ef047c74e687edd446649f9d74e0c6eed87d..f4ee637e6b45522afdee404804b12edf0f1e992e 100644
458--- a/plugins/rails3/rails3.plugin.zsh
459+++ b/plugins/rails3/rails3.plugin.zsh
460@@ -1,13 +1,5 @@
461 # Rails 3 aliases, backwards-compatible with Rails 2.
462
463-function _bundle_command {
464- if command -v bundle && [ -e "Gemfile" ]; then
465- bundle exec $@
466- else
467- $@
468- fi
469-}
470-
471 function _rails_command () {
472 if [ -e "script/server" ]; then
473 ruby script/$@
474@@ -25,6 +17,3 @@ alias rp='_rails_command plugin'
475 alias rs='_rails_command server'
476 alias rsd='_rails_command server --debugger'
477 alias devlog='tail -f log/development.log'
478-
479-alias rspec='_bundle_command rspec'
480-alias cuke='_bundle_command cucumber'
481diff --git a/plugins/redis-cli/_redis-cli b/plugins/redis-cli/_redis-cli
482index 3789add182d2dd0283cf54ccece4f59a04513ac1..1569f29166c5fcff8264bba14785549bdb6a4884 100644
483--- a/plugins/redis-cli/_redis-cli
484+++ b/plugins/redis-cli/_redis-cli
485@@ -51,7 +51,7 @@ _1st_arguments=(
486 'keys:find all keys matching the given pattern'
487 'lastsave:get the UNIX timestamp of the last successful save to disk'
488 'lindex:get an element from a list by its index'
489- 'linset:insert an element before or after another element in a list'
490+ 'linsert:insert an element before or after another element in a list'
491 'llen:get the length of a list'
492 'lpop:remove and get the first element in a list'
493 'lpush:prepend a value to a list'
494diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh
495index 0efc4546f98767de768bef86e9e34169935c4c13..c4e92a1fe00403782e7eacbb0fb5009b5f65629a 100644
496--- a/plugins/ssh-agent/ssh-agent.plugin.zsh
497+++ b/plugins/ssh-agent/ssh-agent.plugin.zsh
498@@ -1,23 +1,62 @@
499-# Based on code from Joseph M. Reagle
500-# http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html
501+#
502+# INSTRUCTIONS
503+#
504+# To enabled agent forwarding support add the following to
505+# your .zshrc file:
506+#
507+# zstyle :omz:plugins:ssh-agent agent-forwarding on
508+#
509+# To load multiple identies use the identities style, For
510+# example:
511+#
512+# zstyle :omz:plugins:ssh-agent id_rsa id_rsa2 id_github
513+#
514+#
515+# CREDITS
516+#
517+# Based on code from Joseph M. Reagle
518+# http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html
519+#
520+# Agent forwarding support based on ideas from
521+# Florent Thoumie and Jonas Pfenniger
522+#
523
524-local SSH_ENV=$HOME/.ssh/environment-$HOST
525+local _plugin__ssh_env=$HOME/.ssh/environment-$HOST
526+local _plugin__forwarding
527
528-function start_agent {
529- /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV}
530- chmod 600 ${SSH_ENV}
531- . ${SSH_ENV} > /dev/null
532- /usr/bin/ssh-add;
533+function _plugin__start_agent()
534+{
535+ local -a identities
536+
537+ # start ssh-agent and setup environment
538+ /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${_plugin__ssh_env}
539+ chmod 600 ${_plugin__ssh_env}
540+ . ${_plugin__ssh_env} > /dev/null
541+
542+ # load identies
543+ zstyle -a :omz:plugins:ssh-agent identities identities
544+ echo starting...
545+ /usr/bin/ssh-add $HOME/.ssh/${^identities}
546 }
547
548-# Source SSH settings, if applicable
549+# test if agent-forwarding is enabled
550+zstyle -b :omz:plugins:ssh-agent agent-forwarding _plugin__forwarding
551+if [[ ${_plugin__forwarding} == "yes" && -n "$SSH_AUTH_SOCK" ]]; then
552+ # Add a nifty symlink for screen/tmux if agent forwarding
553+ [[ -L $SSH_AUTH_SOCK ]] || ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USER-screen
554
555-if [ -f "${SSH_ENV}" ]; then
556- . ${SSH_ENV} > /dev/null
557+elif [ -f "${_plugin__ssh_env}" ]; then
558+ # Source SSH settings, if applicable
559+ . ${_plugin__ssh_env} > /dev/null
560 ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
561- start_agent;
562+ _plugin__start_agent;
563 }
564 else
565- start_agent;
566+ _plugin__start_agent;
567 fi
568
569+# tidy up after ourselves
570+unfunction _plugin__start_agent
571+unset _plugin__forwarding
572+unset _plugin__ssh_env
573+
574diff --git a/plugins/taskwarrior/_task b/plugins/taskwarrior/_task
575new file mode 100644
576index 0000000000000000000000000000000000000000..5bffa9119e439c633ef8fd156b7233fd4ed9b61e
577--- /dev/null
578+++ b/plugins/taskwarrior/_task
579@@ -0,0 +1,280 @@
580+#compdef task
581+#
582+# zsh completion for taskwarrior
583+#
584+# Copyright 2010 - 2011 Johannes Schlatow
585+# Copyright 2009 P.C. Shyamshankar
586+# All rights reserved.
587+#
588+# This script is part of the taskwarrior project.
589+#
590+# This program is free software; you can redistribute it and/or modify it under
591+# the terms of the GNU General Public License as published by the Free Software
592+# Foundation; either version 2 of the License, or (at your option) any later
593+# version.
594+#
595+# This program is distributed in the hope that it will be useful, but WITHOUT
596+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
597+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
598+# details.
599+#
600+# You should have received a copy of the GNU General Public License along with
601+# this program; if not, write to the
602+#
603+# Free Software Foundation, Inc.,
604+# 51 Franklin Street, Fifth Floor,
605+# Boston, MA
606+# 02110-1301
607+# USA
608+#
609+typeset -g _task_cmds _task_projects _task_tags _task_config _task_modifiers
610+_task_projects=($(task _projects))
611+_task_tags=($(task _tags))
612+_task_ids=($(task _ids))
613+_task_config=($(task _config))
614+_task_modifiers=(
615+ 'before' \
616+ 'after' \
617+ 'none' \
618+ 'any' \
619+ 'is' \
620+ 'isnt' \
621+ 'has' \
622+ 'hasnt' \
623+ 'startswith' \
624+ 'endswith' \
625+ 'word' \
626+ 'noword'
627+)
628+_task_cmds=($(task _commands))
629+_task_zshcmds=( ${(f)"$(task _zshcommands)"} )
630+
631+
632+_task_idCmds=(
633+ 'append' \
634+ 'prepend' \
635+ 'annotate' \
636+ 'denotate' \
637+ 'edit' \
638+ 'duplicate' \
639+ 'info' \
640+ 'start' \
641+ 'stop' \
642+ 'done'
643+)
644+
645+_task_idCmdsDesc=(
646+ 'append:Appends more description to an existing task.' \
647+ 'prepend:Prepends more description to an existing task.' \
648+ 'annotate:Adds an annotation to an existing task.' \
649+ 'denotate:Deletes an annotation of an existing task.' \
650+ 'edit:Launches an editor to let you modify a task directly.' \
651+ 'duplicate:Duplicates the specified task, and allows modifications.' \
652+ 'info:Shows all data, metadata for specified task.' \
653+ 'start:Marks specified task as started.' \
654+ 'stop:Removes the start time from a task.' \
655+ 'done:Marks the specified task as completed.'
656+)
657+
658+_task() {
659+ _arguments -s -S \
660+ "*::task command:_task_commands"
661+ return 0
662+}
663+
664+local -a reply args word
665+word=$'[^\0]#\0'
666+
667+# priorities
668+local -a task_priorities
669+_regex_words values 'task priorities' \
670+ 'H:High' \
671+ 'M:Middle' \
672+ 'L:Low'
673+task_priorities=("$reply[@]")
674+
675+# projects
676+local -a task_projects
677+task_projects=(
678+ /"$word"/
679diff --git a/plugins/taskwarrior/taskwarrior.plugin.zsh b/plugins/taskwarrior/taskwarrior.plugin.zsh
680new file mode 100644
681index 0000000000000000000000000000000000000000..c1830042eff664d503d7b8d9fbcd1bc6605ee29f
682--- /dev/null
683+++ b/plugins/taskwarrior/taskwarrior.plugin.zsh
684@@ -0,0 +1,21 @@
685+################################################################################
686+# Author: Pete Clark
687+# Email: pete[dot]clark[at]gmail[dot]com
688+# Version: 0.1 (05/24/2011)
689+# License: WTFPL<http://sam.zoy.org/wtfpl/>
690+#
691+# This oh-my-zsh plugin adds smart tab completion for
692+# TaskWarrior<http://taskwarrior.org/>. It uses the zsh tab completion
693+# script (_task) distributed with TaskWarrior for the completion definitions.
694+#
695+# Typing task[tabtab] will give you a list of current tasks, task 66[tabtab]
696+# gives a list of available modifications for that task, etc.
697+################################################################################
698+
699+zstyle ':completion:*:*:task:*' verbose yes
700+zstyle ':completion:*:*:task:*:descriptions' format '%U%B%d%b%u'
701+
702+zstyle ':completion:*:*:task:*' group-name ''
703+
704+alias t=task
705+compdef _task t=task
706diff --git a/themes/blinks.zsh-theme b/themes/blinks.zsh-theme
707new file mode 100644
708index 0000000000000000000000000000000000000000..3db7012f4b0be2befebfa926184cee55e1744b00
709--- /dev/null
710+++ b/themes/blinks.zsh-theme
711@@ -0,0 +1,20 @@
712+# https://github.com/blinks zsh theme
713+
714+function _prompt_char() {
715+ if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then
716+ echo "%{%F{blue}%}±%{%f%k%b%}"
717+ else
718+ echo ' '
719+ fi
720+}
721+
722+ZSH_THEME_GIT_PROMPT_PREFIX=" [%{%B%F{blue}%}"
723+ZSH_THEME_GIT_PROMPT_SUFFIX="%{%f%k%b%K{black}%B%F{green}%}]"
724+ZSH_THEME_GIT_PROMPT_DIRTY=" %{%F{red}%}*%{%f%k%b%}"
725+ZSH_THEME_GIT_PROMPT_CLEAN=""
726+
727+PROMPT='%{%f%k%b%}
728+%{%K{black}%B%F{green}%}%n%{%B%F{blue}%}@%{%B%F{cyan}%}%m%{%B%F{green}%} %{%b%F{yellow}%K{black}%}%~%{%B%F{green}%}$(git_prompt_info)%E%{%f%k%b%}
729+%{%K{black}%}$(_prompt_char)%{%K{black}%} %#%{%f%k%b%} '
730+
731+RPROMPT='!%{%B%F{cyan}%}%!%{%f%k%b%}'
732diff --git a/themes/philips.zsh-theme b/themes/philips.zsh-theme
733index e7ea51a2ff8202536a24790780064ecf0d6ade7f..f6e5b324e0b1eee296b9311a7f1913de15edc720 100644
734--- a/themes/philips.zsh-theme
735+++ b/themes/philips.zsh-theme
736@@ -7,8 +7,8 @@ RPROMPT='[%*]'
737 ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[red]%}%B"
738 ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%})%{$reset_color%} "
739 ZSH_THEME_GIT_PROMPT_CLEAN=""
740-ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}"
741+ZSH_THEME_GIT_PROMPT_DIRTY="*"
742
743 # LS colors, made with http://geoff.greer.fm/lscolors/
744 export LSCOLORS="Gxfxcxdxbxegedabagacad"
745diff --git a/themes/sunrise.zsh-theme b/themes/sunrise.zsh-theme
746new file mode 100644
747index 0000000000000000000000000000000000000000..88b371d792f4d1620e03bf80b0e9fa7654ab9c06
748--- /dev/null
749+++ b/themes/sunrise.zsh-theme
750@@ -0,0 +1,96 @@
751+#-------------------------------------------------------------------------------
752+# Sunrise theme for oh-my-zsh by Adam Lindberg (eproxus@gmail.com)
753+# Intended to be used with Solarized: http://ethanschoonover.com/solarized
754+# (Needs Git plugin for current_branch method)
755+#-------------------------------------------------------------------------------
756+
757+# Color shortcuts
758+R=$fg[red]
759+G=$fg[green]
760+M=$fg[magenta]
761+RB=$fg_bold[red]
762+YB=$fg_bold[yellow]
763+BB=$fg_bold[blue]
764+RESET=$reset_color
765+
766+if [ "$(whoami)" = "root" ]; then
767+ PROMPTCOLOR="%{$RB%}" PREFIX="-!-";
768+else
769+ PROMPTCOLOR="" PREFIX="---";
770+fi
771+
772+local return_code="%(?..%{$R%}%? ↵%{$RESET%})"
773+
774+# Get the status of the working tree (copied and modified from git.zsh)
775+custom_git_prompt_status() {
776+ INDEX=$(git status --porcelain 2> /dev/null)
777+ STATUS=""
778+ # Non-staged
779+ if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
780+ STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
781+ fi
782+ if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
783+ STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
784+ fi
785+ if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
786+ STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
787+ fi
788+ if $(echo "$INDEX" | grep '^.M ' &> /dev/null); then
789+ STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
790+ elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then
791+ STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
792+ elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then
793+ STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
794+ fi
795+ # Staged
796+ if $(echo "$INDEX" | grep '^D ' &> /dev/null); then
797+ STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_DELETED$STATUS"
798+ fi
799+ if $(echo "$INDEX" | grep '^R' &> /dev/null); then
800+ STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_RENAMED$STATUS"
801+ fi
802+ if $(echo "$INDEX" | grep '^M' &> /dev/null); then
803+ STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_MODIFIED$STATUS"
804+ fi
805+ if $(echo "$INDEX" | grep '^A' &> /dev/null); then
806+ STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_ADDED$STATUS"
807+ fi
808+
809+ if $(echo -n "$STATUS" | grep '.*' &> /dev/null); then
810+ STATUS="$ZSH_THEME_GIT_STATUS_PREFIX$STATUS"
811+ fi
812+
813+ echo $STATUS
814+}
815+
816+# get the name of the branch we are on (copied and modified from git.zsh)
817+function custom_git_prompt() {
818+ ref=$(git symbolic-ref HEAD 2> /dev/null) || return
819+ echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$(git_prompt_ahead)$(custom_git_prompt_status)$ZSH_THEME_GIT_PROMPT_SUFFIX"
820+}
821+
822+# %B sets bold text
823+PROMPT='%B$PREFIX %2~ $(custom_git_prompt)%{$M%}%B»%b%{$RESET%} '
824+RPS1="${return_code}"
825+
826+ZSH_THEME_GIT_PROMPT_PREFIX="%{$YB%}‹"
827+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$YB%}›%{$RESET%} "
828+
829+ZSH_THEME_GIT_PROMPT_DIRTY="%{$R%}*"
830+ZSH_THEME_GIT_PROMPT_CLEAN=""
831+
832+ZSH_THEME_GIT_PROMPT_AHEAD="%{$BB%}➔"
833+
834+ZSH_THEME_GIT_STATUS_PREFIX=" "
835+
836+# Staged
837+ZSH_THEME_GIT_PROMPT_STAGED_ADDED="%{$G%}A"
838+ZSH_THEME_GIT_PROMPT_STAGED_MODIFIED="%{$G%}M"
839+ZSH_THEME_GIT_PROMPT_STAGED_RENAMED="%{$G%}R"
840+ZSH_THEME_GIT_PROMPT_STAGED_DELETED="%{$G%}D"
841+
842+# Not-staged
843+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$R%}⁇"
844+ZSH_THEME_GIT_PROMPT_MODIFIED="%{$R%}M"
845+ZSH_THEME_GIT_PROMPT_DELETED="%{$R%}D"
846+ZSH_THEME_GIT_PROMPT_UNMERGED="%{$R%}UU"
847diff --git a/tools/upgrade.sh b/tools/upgrade.sh
848index e30488822e99ddc93f2fe41a6d2753441511142b..2b75e5541dca2eb7843e55c47adb4f6cb0b9bd65 100644
849--- a/tools/upgrade.sh
850+++ b/tools/upgrade.sh
851@@ -9,4 +9,4 @@ echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m
852 echo "\033[0;32m"' /____/ '"\033[0m"
853 echo "\033[0;34mHooray! Oh My Zsh has been updated and/or is at the current version.\033[0m"
854 echo "\033[0;34mTo keep up on the latest, be sure to follow Oh My Zsh on twitter: \033[1mhttp://twitter.com/ohmyzsh\033[0m"
855-cd $current_path
856+cd "$current_path"