forked from chagel/itodo
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7a586f3
Showing
6 changed files
with
152 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.cache | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ // iTodo plugin | ||
{ "keys": ["super+\\"], "command": "itodo" } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import sublime, sublime_plugin | ||
from datetime import datetime | ||
|
||
class ItodoCommand(sublime_plugin.TextCommand): | ||
def run(self, edit): | ||
# only work on .todo files | ||
filename = self.view.file_name() | ||
if filename is None or not filename.endswith('.todo'): | ||
return False | ||
|
||
for region in self.view.sel(): | ||
line = self.view.line(region) | ||
line_contents = self.view.substr(line).strip() | ||
|
||
# prepend @done if item is ongoing | ||
if line_contents.startswith('-'): | ||
self.view.insert(edit, line.end(), " @done (%s)" % datetime.now().strftime("%Y-%m-%d %H:%M")) | ||
self.view.replace(edit, self.view.word(line.begin()), "+ ") | ||
# undo @todo | ||
elif line_contents.startswith('+'): | ||
subfix = self.view.find('(\s)*@done(.)+\)$', line.begin()) | ||
self.view.erase(edit, subfix) | ||
self.view.replace(edit, self.view.word(line.begin()), "- ") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>fileTypes</key> | ||
<array> | ||
<string>todo</string> | ||
</array> | ||
<key>keyEquivalent</key> | ||
<string>^~T</string> | ||
<key>name</key> | ||
<string>iTodo</string> | ||
<key>patterns</key> | ||
<array> | ||
<dict> | ||
<key>match</key> | ||
<string>^\s*(\w+.+:\s*$\n?)</string> | ||
<key>name</key> | ||
<string>keyword.control.header.itodo</string> | ||
</dict> | ||
<dict> | ||
<key>captures</key> | ||
<dict> | ||
<key>1</key> | ||
<dict> | ||
<key>name</key> | ||
<string>punctuation.definition.bullet.completed.itodo</string> | ||
</dict> | ||
<key>2</key> | ||
<dict> | ||
<key>name</key> | ||
<string>comment.line.completed.itodo</string> | ||
</dict> | ||
</dict> | ||
<key>match</key> | ||
<string>^\s*(\+|✓)\s+((?:[^\@]|(?<!\s)\@|\@(?=\s))*)</string> | ||
<key>name</key> | ||
<string>meta.item.itodo.completed</string> | ||
</dict> | ||
<dict> | ||
<key>captures</key> | ||
<dict> | ||
<key>1</key> | ||
<dict> | ||
<key>name</key> | ||
<string>punctuation.definition.bullet.pending.itodo</string> | ||
</dict> | ||
<key>2</key> | ||
<dict> | ||
<key>name</key> | ||
<string>text.pending.itodo</string> | ||
</dict> | ||
</dict> | ||
<key>match</key> | ||
<string>^\s*(-)\s+((?:[^\@]|(?<!\s)\@)*)</string> | ||
<key>name</key> | ||
<string>meta.item.itodo.pending</string> | ||
</dict> | ||
<dict> | ||
<key>match</key> | ||
<string>(?<=\s)\@(?!today|completed|done)[\w\d\-!?]+\s?</string> | ||
<key>name</key> | ||
<string>meta.tag.itodo</string> | ||
</dict> | ||
<dict> | ||
<key>match</key> | ||
<string>(?<=\s)\@done \([\d\.:\-/ ].+\)\s?</string> | ||
<key>name</key> | ||
<string>meta.tag.itodo.completed</string> | ||
</dict> | ||
<dict> | ||
<key>match</key> | ||
<string>(?<=\s)\@today\s?</string> | ||
<key>name</key> | ||
<string>string.other.tag.itodo.today</string> | ||
</dict> | ||
</array> | ||
<key>scopeName</key> | ||
<string>text.itodo</string> | ||
<key>uuid</key> | ||
<string>8fj2g29c-04ef-4330-9a6b-9b99aae1c418</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
iTodo for Sublime Text | ||
------------------ | ||
|
||
iTodo is a GTD tool for managing todo list in Sublime Text editor. | ||
|
||
Description | ||
------------------ | ||
|
||
This plugin contains one text command names 'itodo' and a syntax definition with the same name. | ||
|
||
Usage | ||
------------------ | ||
|
||
"CMD + \": toggle task completed | ||
|
||
|
||
Samples | ||
------------------ | ||
|
||
Suppose we have a following todo file: | ||
|
||
Project A: | ||
- call mum tomorrow at 8 am. | ||
|
||
Highlight this item line and press "CMD + \", it marks a tag "@done" and also appends timestamp. | ||
|
||
Project A: | ||
+ call mum tomorrow at 8 am. @done (2012-01-08 18:12) | ||
|
||
|
||
Contribution | ||
------------------ | ||
|
||
Thanks Taskmate for TextMate (https://github.com/svenfuchs/taskmate). | ||
|
||
|
||
Source / Installation | ||
------------------ | ||
|
||
https://github.com/chagel/itodo |