1eb52d43851ae2d9bdeff3df073976e1935f5979

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

Message

Merge pull request #370 from lepht/taskwarrior-plugin

Taskwarrior plugin

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/plugins/taskwarrior/_task b/plugins/taskwarrior/_task
 11new file mode 100644
 12index 0000000000000000000000000000000000000000..5bffa9119e439c633ef8fd156b7233fd4ed9b61e
 13--- /dev/null
 14+++ b/plugins/taskwarrior/_task
 15@@ -0,0 +1,280 @@
 16+#compdef task
 17+#
 18+# zsh completion for taskwarrior
 19+#
 20+# Copyright 2010 - 2011 Johannes Schlatow
 21+# Copyright 2009 P.C. Shyamshankar
 22+# All rights reserved.
 23+#
 24+# This script is part of the taskwarrior project.
 25+#
 26+# This program is free software; you can redistribute it and/or modify it under
 27+# the terms of the GNU General Public License as published by the Free Software
 28+# Foundation; either version 2 of the License, or (at your option) any later
 29+# version.
 30+#
 31+# This program is distributed in the hope that it will be useful, but WITHOUT
 32+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 33+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 34+# details.
 35+#
 36+# You should have received a copy of the GNU General Public License along with
 37+# this program; if not, write to the
 38+#
 39+#     Free Software Foundation, Inc.,
 40+#     51 Franklin Street, Fifth Floor,
 41+#     Boston, MA
 42+#     02110-1301
 43+#     USA
 44+#
 45+typeset -g _task_cmds _task_projects _task_tags _task_config _task_modifiers
 46+_task_projects=($(task _projects))
 47+_task_tags=($(task _tags))
 48+_task_ids=($(task _ids))
 49+_task_config=($(task _config))
 50+_task_modifiers=(
 51+	'before' \
 52+	'after' \
 53+	'none' \
 54+	'any' \
 55+	'is' \
 56+	'isnt' \
 57+	'has' \
 58+	'hasnt' \
 59+	'startswith' \
 60+	'endswith' \
 61+	'word' \
 62+	'noword'
 63+)
 64+_task_cmds=($(task _commands))
 65+_task_zshcmds=( ${(f)"$(task _zshcommands)"} )
 66+
 67+
 68+_task_idCmds=(
 69+	'append' \
 70+	'prepend' \
 71+	'annotate' \
 72+	'denotate' \
 73+	'edit' \
 74+	'duplicate' \
 75+	'info' \
 76+	'start' \
 77+	'stop' \
 78+	'done'
 79+)
 80+
 81+_task_idCmdsDesc=(
 82+	'append:Appends more description to an existing task.' \
 83+	'prepend:Prepends more description to an existing task.' \
 84+	'annotate:Adds an annotation to an existing task.' \
 85+	'denotate:Deletes an annotation of an existing task.' \
 86+	'edit:Launches an editor to let you modify a task directly.' \
 87+	'duplicate:Duplicates the specified task, and allows modifications.' \
 88+	'info:Shows all data, metadata for specified task.' \
 89+	'start:Marks specified task as started.' \
 90+	'stop:Removes the start time from a task.' \
 91+	'done:Marks the specified task as completed.'
 92+)
 93+
 94+_task() {
 95+    _arguments -s -S \
 96+        "*::task command:_task_commands"
 97+    return 0
 98+}
 99+
100+local -a reply args word
101+word=$'[^\0]#\0'
102+
103+# priorities
104+local -a task_priorities
105+_regex_words values 'task priorities' \
106+	'H:High' \
107+	'M:Middle' \
108+	'L:Low'
109+task_priorities=("$reply[@]")
110+
111+# projects
112+local -a task_projects
113+task_projects=(
114+	/"$word"/
115diff --git a/plugins/taskwarrior/taskwarrior.plugin.zsh b/plugins/taskwarrior/taskwarrior.plugin.zsh
116new file mode 100644
117index 0000000000000000000000000000000000000000..c1830042eff664d503d7b8d9fbcd1bc6605ee29f
118--- /dev/null
119+++ b/plugins/taskwarrior/taskwarrior.plugin.zsh
120@@ -0,0 +1,21 @@
121+################################################################################
122+# Author: Pete Clark
123+# Email: pete[dot]clark[at]gmail[dot]com
124+# Version: 0.1 (05/24/2011)
125+# License: WTFPL<http://sam.zoy.org/wtfpl/>
126+#
127+# This oh-my-zsh plugin adds smart tab completion for
128+# TaskWarrior<http://taskwarrior.org/>. It uses the zsh tab completion
129+# script (_task) distributed with TaskWarrior for the completion definitions.
130+#
131+# Typing task[tabtab] will give you a list of current tasks, task 66[tabtab]
132+# gives a list of available modifications for that task, etc.
133+################################################################################
134+
135+zstyle ':completion:*:*:task:*' verbose yes
136+zstyle ':completion:*:*:task:*:descriptions' format '%U%B%d%b%u'
137+
138+zstyle ':completion:*:*:task:*' group-name ''
139+
140+alias t=task
141+compdef _task t=task