├── Support
├── excluded.gtd
├── contexts.gtd
├── gtd_functions.rb
└── template.rhtml
├── Preferences
└── Page Name.tmPreferences
├── Commands
├── Done.tmCommand
├── Priority.tmCommand
├── GTD List View.tmCommand
├── Active GTD List View.tmCommand
├── Wait.tmCommand
├── Delegate.tmCommand
├── Undo State Change.tmCommand
├── Cleanup.tmCommand
├── Remove Completed Tasks.tmCommand
├── Create Project List.tmCommand
├── Archive Task.tmCommand
├── Execute Tab Command.tmCommand
├── Export to GeekTool.tmCommand
└── Help.tmCommand
├── README.mdown
├── Syntaxes
└── GTD.tmLanguage
└── info.plist
/Support/excluded.gtd:
--------------------------------------------------------------------------------
1 | excluded.gtd
2 | contexts.gtd
3 | someday.gtd
4 | backup.gtd
5 | #EMAIL
6 |
--------------------------------------------------------------------------------
/Preferences/Page Name.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Page Name
7 | scope
8 | markup.other.pagename
9 | settings
10 |
11 | spellChecking
12 | 0
13 | underline
14 | 1
15 |
16 | uuid
17 | 2417D353-C7F0-4F5C-9CA2-1294CBDC53A4
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Support/contexts.gtd:
--------------------------------------------------------------------------------
1 | * PROJECT|p|* ${1:new project}|*|990099
2 | - TASK|t|- TASK ${1:new task}|TASK|006600
3 | - COMPUTER|m|- COMPUTER ${1:computer task}|COMPUTER|660000
4 | - EMAIL|e|- EMAIL ${1:person} re: ${0:subject}|EMAIL|996600
5 | - CALL|c|- CALL ${1:person} re: ${2:subject} ${0:#}|CALL|FF6600
6 | - WEB|we|- WEB ${1:new webwork}|WEB|00000f
7 | - READ|r|- READ ${1:book or article}|READ|f00000
8 | - ERRANDS|er|- ERRANDS ${1:new task}|ERRANDS|011fff
9 | - SOMEDAY|sd|- SOMEDAY ${1:new task}|SOMEDAY|02222f
10 | - SCHOOL|s|- SCHOOL ${1:new task}|SCHOOL|0000ff
11 | - CHORES|ch|- CHORES ${1:task}|CHORES|0222ff
12 | - OTHER|oo|- other|OTHER|00ffff
13 | - BUY|b|- BUY ${1:new purchase}|BUY|6699CC
14 | ^ INFO|i|^ INFO ${1:new info}|^|336633
15 | -> DELEGATE|d|-> DELEGATE|->|336633
16 | <- WAIT|w|<- WAIT|<-|336633
17 | + DONE|d|DONE|+|666666
--------------------------------------------------------------------------------
/Commands/Done.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/usr/bin/env python
9 | import sys, os
10 |
11 | oldtask = os.environ['TM_CURRENT_LINE']
12 | sys.stdout.write("+ " + oldtask[3:])
13 |
14 | fallbackInput
15 | line
16 | input
17 | selection
18 | name
19 | Done
20 | output
21 | replaceSelectedText
22 | scope
23 | text.html.markdown.wiki.gtd
24 | tabTrigger
25 | d
26 | uuid
27 | 3EA8AD43-5ED3-4FB3-9296-D37A409AABF8
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Commands/Priority.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/usr/bin/env python
9 | import sys, os
10 |
11 | oldtask = os.environ['TM_CURRENT_LINE']
12 | sys.stdout.write("! " + oldtask[3:])
13 |
14 | fallbackInput
15 | line
16 | input
17 | selection
18 | name
19 | Priority
20 | output
21 | replaceSelectedText
22 | scope
23 | text.html.markdown.wiki.gtd
24 | tabTrigger
25 | p
26 | uuid
27 | 4BAAE940-7F72-4184-B165-F028FB6E99FF
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Commands/GTD List View.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | saveActiveFile
7 | command
8 | #!/usr/bin/env ruby18
9 |
10 | require "#{ENV['TM_SUPPORT_PATH']}/lib/textmate"
11 | require "erb"
12 | require "pp"
13 | include ERB::Util
14 | require "#{ENV['TM_BUNDLE_SUPPORT']}/gtd_functions"
15 |
16 | displayAllTasks
17 | input
18 | none
19 | keyEquivalent
20 | ^@T
21 | name
22 | GTD List View
23 | output
24 | showAsHTML
25 | scope
26 | text.html.markdown.wiki.gtd
27 | uuid
28 | 4351CBE0-CE02-472E-A0A9-F9F895B2946C
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Commands/Active GTD List View.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | saveActiveFile
7 | command
8 | #!/usr/bin/env ruby18
9 |
10 | require "#{ENV['TM_SUPPORT_PATH']}/lib/textmate"
11 | require "erb"
12 | require "pp"
13 | include ERB::Util
14 | require "#{ENV['TM_BUNDLE_SUPPORT']}/gtd_functions"
15 |
16 | displayTasks
17 |
18 | input
19 | none
20 | keyEquivalent
21 | ^T
22 | name
23 | Active GTD List View
24 | output
25 | showAsHTML
26 | scope
27 | text.html.markdown.wiki.gtd
28 | uuid
29 | A108E6E4-317A-4883-B152-11A9E115BF1C
30 |
31 |
32 |
--------------------------------------------------------------------------------
/Commands/Wait.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/usr/bin/env python
9 | import sys, os
10 |
11 | oldtask = os.environ['TM_CURRENT_LINE']
12 | if (oldtask[0] != "+") and (oldtask[0] != "^"):
13 | sys.stdout.write("<- " + oldtask[3:])
14 | else:
15 | sys.stdout.write(oldtask)
16 | fallbackInput
17 | line
18 | input
19 | selection
20 | name
21 | Wait
22 | output
23 | replaceSelectedText
24 | scope
25 | text.html.markdown.wiki.gtd
26 | tabTrigger
27 | w
28 | uuid
29 | 4C31BAAA-2182-47D7-8B10-2B17A6078FCA
30 |
31 |
32 |
--------------------------------------------------------------------------------
/Commands/Delegate.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/usr/bin/env python
9 | import sys, os
10 |
11 | oldtask = os.environ['TM_CURRENT_LINE']
12 | if (oldtask[0] != "+") and (oldtask[0] != "^"):
13 | sys.stdout.write("-> " + oldtask[3:])
14 | else:
15 | sys.stdout.write(oldtask)
16 | fallbackInput
17 | line
18 | input
19 | selection
20 | name
21 | Delegate
22 | output
23 | replaceSelectedText
24 | scope
25 | text.html.markdown.wiki.gtd
26 | tabTrigger
27 | f
28 | uuid
29 | DCE997E1-D107-4873-A297-6CF808401DA3
30 |
31 |
32 |
--------------------------------------------------------------------------------
/Commands/Undo State Change.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/usr/bin/env python
9 | import sys, os
10 |
11 | oldtask = os.environ['TM_CURRENT_LINE']
12 | if (oldtask[0] != "+") and (oldtask[0] != "^"):
13 | sys.stdout.write("- " + oldtask[3:])
14 | else:
15 | sys.stdout.write(oldtask)
16 | fallbackInput
17 | line
18 | input
19 | selection
20 | name
21 | Undo State Change
22 | output
23 | replaceSelectedText
24 | scope
25 | text.html.markdown.wiki.gtd
26 | tabTrigger
27 | u
28 | uuid
29 | 900C7391-7C63-4D1C-AF83-9F3E497F6A7F
30 |
31 |
32 |
--------------------------------------------------------------------------------
/Commands/Cleanup.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | saveActiveFile
7 | command
8 | #!/usr/bin/env ruby18
9 |
10 | myFile = ENV['TM_SELECTED_FILE']
11 |
12 | myText = File.open(myFile)
13 | re = /\s/
14 | myText.each do |line|
15 | #myTest = re.match(line)
16 | #if (myTest.pre_match != "+" and myTest.pre_match.length > 0)
17 | if line.length > 1
18 | puts line
19 | end
20 | end
21 | input
22 | document
23 | keyEquivalent
24 | ^C
25 | name
26 | Cleanup
27 | output
28 | replaceDocument
29 | scope
30 | text.html.markdown.wiki.gtd
31 | uuid
32 | 0CE0800F-C66A-476A-B67A-5B22087D4E70
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Commands/Remove Completed Tasks.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | saveActiveFile
7 | command
8 | #!/usr/bin/env ruby18
9 |
10 | myFile = ENV['TM_SELECTED_FILE']
11 |
12 | myText = File.open(myFile)
13 | re = /\s/
14 | myText.each do |line|
15 | myTest = re.match(line)
16 | if (myTest.pre_match != "+" and myTest.pre_match.length > 0)
17 | puts line
18 | end
19 | end
20 |
21 | input
22 | document
23 | keyEquivalent
24 | ^~C
25 | name
26 | Remove Completed Tasks
27 | output
28 | replaceDocument
29 | scope
30 | text.html.markdown.wiki.gtd
31 | uuid
32 | D1E96B26-25A1-4525-873C-417598FB8814
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Commands/Create Project List.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/usr/bin/env ruby18
9 |
10 | require "#{ENV['TM_SUPPORT_PATH']}/lib/textmate"
11 |
12 | $myPath = ENV['TM_DIRECTORY']
13 |
14 | myFiles = Dir.entries($myPath)
15 | myProjects = []
16 | myFiles.each do |fileName|
17 | if fileName[-3,3] == "gtd"
18 | myProjects.push fileName
19 | end
20 | end
21 |
22 | puts myProjects
23 | input
24 | none
25 | keyEquivalent
26 | ^P
27 | name
28 | Create Project List
29 | output
30 | replaceDocument
31 | scope
32 | text.html.markdown.wiki.gtd
33 | uuid
34 | DC188528-1C29-47BA-9DBB-29A0C97C5655
35 |
36 |
37 |
--------------------------------------------------------------------------------
/README.mdown:
--------------------------------------------------------------------------------
1 | # Installation
2 |
3 | You can install this bundle in TextMate by opening the preferences and going to the bundles tab. After installation it will be automatically updated for you.
4 |
5 | # General
6 |
7 | * [Bundle Styleguide](http://kb.textmate.org/bundle_styleguide) — _before you make changes_
8 | * [Commit Styleguide](http://kb.textmate.org/commit_styleguide) — _before you send a pull request_
9 | * [Writing Bug Reports](http://kb.textmate.org/writing_bug_reports) — _before you report an issue_
10 |
11 | # License
12 |
13 | If not otherwise specified (see below), files in this repository fall under the following license:
14 |
15 | Permission to copy, use, modify, sell and distribute this
16 | software is granted. This software is provided "as is" without
17 | express or implied warranty, and with no claim as to its
18 | suitability for any purpose.
19 |
20 | An exception is made for files in readable text which contain their own license information, or files where an accompanying file exists (in the same directory) with a “-license” suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example “tidy” is accompanied by “tidy-license.txt”.
--------------------------------------------------------------------------------
/Commands/Archive Task.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/usr/bin/env ruby18
9 | # just to remind you of some useful environment variables
10 | # see Help / Environment Variables for the full list
11 | # echo File: "$TM_FILEPATH"
12 |
13 | archiveDate = `date +%Y-%m-%d`
14 | myArchive = ENV['TM_PROJECT_DIRECTORY'].to_s + '/ArchivedTasks.gtd'
15 | myTasks = ''
16 | myTask = (`date +%Y-%m-%d`).chomp + " " + ENV['TM_FILENAME'][0..-5] + ": " + ENV['TM_CURRENT_LINE'][3..-1]
17 | #puts myArchive
18 |
19 | unless (File.exists?(myArchive))
20 | exec "touch #{myArchive}"
21 | end
22 |
23 | File.open(myArchive, "r").each do |line|
24 | myTasks = myTasks + line
25 | end
26 |
27 | myTasks = myTasks + myTask + "\n"
28 |
29 | File.open(myArchive, "w") do |f|
30 | f << myTasks
31 | end
32 | fallbackInput
33 | line
34 | input
35 | selection
36 | name
37 | Archive Task
38 | output
39 | replaceSelectedText
40 | scope
41 | text.html.markdown.wiki.gtd
42 | tabTrigger
43 | a
44 | uuid
45 | 7FC498D7-1477-445B-A39B-FA63FDF10742
46 |
47 |
48 |
--------------------------------------------------------------------------------
/Syntaxes/GTD.tmLanguage:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | fileTypes
6 |
7 | gtd
8 |
9 | keyEquivalent
10 | ^~G
11 | name
12 | GTD
13 | patterns
14 |
15 |
16 | match
17 | [A-Z][a-z]+([A-Z][a-z]*)+
18 | name
19 | markup.other.pagename
20 |
21 |
22 | match
23 | ^-\s{2}\S+\s
24 | name
25 | string.unquoted.gtd
26 |
27 |
28 | match
29 | ^<-\s\S+\s
30 | name
31 | entity.name.tag.gtd
32 |
33 |
34 | match
35 | ^->\s\S+\s
36 | name
37 | constant.language.gtd
38 |
39 |
40 | match
41 | ^\+\s{2}\S+\s
42 | name
43 | variable.language.gtd
44 |
45 |
46 | match
47 | ^\^\s{2}\S+\s
48 | name
49 | comment.line.gtd
50 |
51 |
52 | match
53 | ^\!\s{2}\S+\s
54 | name
55 | support.class.exception.gtd
56 |
57 |
58 | scopeName
59 | text.html.markdown.wiki.gtd
60 | uuid
61 | A984336E-2C65-4152-8FC0-34D2E73721DA
62 |
63 |
64 |
--------------------------------------------------------------------------------
/Commands/Execute Tab Command.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/usr/bin/env ruby18
9 |
10 | # To use this function, type the desired key followed by "Enter"
11 | #
12 | # Note - the search for the tab command will stop at the first match,
13 | # so put longer commands before shorter, e.g., tw before t.
14 |
15 | # This is where the GTD files are kept
16 | $myPath = ENV['TM_DIRECTORY']
17 | tabCommand = ENV['TM_CURRENT_LINE']
18 |
19 | $contexts = [] #user defined contexts
20 | def readContexts(a)
21 | # processes contexts.gtd into script
22 | context, tabCommand, tabString, regex, color = a.split(/\|/)
23 | $contexts.push({:context => tabCommand, :tabString => tabString})
24 | end
25 |
26 |
27 | def reportContexts
28 | # a simple test
29 | $contexts.each do |tag|
30 | puts("Context: " + tag[:context])
31 | puts("tabCommand: " + tag[:tabCommand])
32 | puts("tabString: " + tag[:tabString])
33 | puts("Search String: " + tag[:regex])
34 | puts("Color: " + tag[:color])
35 | i = 0
36 | while i < tag[:tasks].length
37 | puts "Task: " + tag[:tasks][i]
38 | i = i + 1
39 | end
40 | end
41 | end
42 |
43 | def myParse tabCommand
44 | found = 0
45 | $contexts.each do |tag|
46 | re = tag[:context]
47 | if (tabCommand == re) and (found == 0)
48 | print tag[:tabString]
49 | found = 1
50 | end
51 | end
52 | if found == 0
53 | puts "failed"
54 | end
55 | end
56 |
57 |
58 | # the contexts.gtd file is read, and converted into $contexts
59 | file = File.open($myPath+"/contexts.gtd", "r")
60 | file.each do |line|
61 | readContexts(line)
62 | end
63 |
64 | myParse tabCommand
65 | fallbackInput
66 | line
67 | input
68 | selection
69 | keyEquivalent
70 |
71 | name
72 | Execute Tab Command
73 | output
74 | insertAsSnippet
75 | scope
76 | text.html.markdown.wiki.gtd
77 | uuid
78 | 1CEC5F39-6479-4C96-BD24-EF49F0A19F9B
79 |
80 |
81 |
--------------------------------------------------------------------------------
/Commands/Export to GeekTool.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | saveActiveFile
7 | command
8 | #!/usr/bin/env ruby18
9 |
10 | require "#{ENV['TM_SUPPORT_PATH']}/lib/textmate"
11 | require "erb"
12 | require "pp"
13 | include ERB::Util
14 | require "#{ENV['TM_BUNDLE_SUPPORT']}/gtd_functions"
15 |
16 | $myPath = ENV['TM_DIRECTORY']
17 | $tags = [] #user defined contexts
18 |
19 | def readContexts(a)
20 | # processes contexts.gtd into script
21 | context, tabCommand, tabString, regex, color = a.split(/\|/)
22 | if context != "+ DONE"
23 | $tags.push({:label => context[3..-1], :regexp => regex, :color => color, :matches => []})
24 | end
25 | end
26 |
27 | # the contexts.gtd file is read, and converted into $contexts
28 | file = File.open($myPath+"/contexts.gtd", "r")
29 | file.each do |line|
30 | readContexts(line)
31 | end
32 |
33 | # new feature - exclusion of selected files
34 | # this allows you to select which lists are included
35 | # in list views
36 | class ExList
37 | def initialize
38 | @values = []
39 | end
40 | def contains(test)
41 | found = true
42 | @values.each do |item|
43 | if test == item.chomp
44 | found = false
45 | end
46 | end
47 | return found
48 | end
49 | def add(item)
50 | @values.push item
51 | end
52 | def print
53 | puts @values
54 | end
55 | end
56 |
57 | xFile = File.open($myPath+"/excluded.gtd", "r")
58 |
59 | myList = ExList.new
60 |
61 | xFile.each do |line|
62 | myList.add(line)
63 | end
64 |
65 | # sorting happens
66 | todoList = ""
67 | $tags.each do |tag|
68 | context = tag[:regexp]
69 | matches = 0
70 | myFiles = Dir.entries($myPath)
71 | myFiles.each do |fileName|
72 | if ((fileName[-3,3] == "gtd") and myList.contains(fileName))
73 | lineno = 0
74 | mFile = File.open(fileName)
75 | mFile.each do |line|
76 | lineno = lineno + 1
77 | tLine = line[3..-1]
78 | if tLine != nil
79 | re = /\s/
80 | if line[0..1] == "- "
81 | ctask = re.match(tLine)
82 | else
83 | ctask = re.match(line)
84 | end
85 | if (ctask.pre_match == context) and ((line[0..2] == "- ") or (line[0..2] == "! "))
86 | results = (fileName[0..-5] + ":" + lineno.to_s + ": " + ctask.post_match)
87 | matches += 1
88 | if matches == 1
89 | todoList += "\n" + tag[:label] + "\n"
90 | end
91 | todoList += results
92 | end
93 | end
94 | end
95 | end
96 | end
97 | if matches == 0
98 | # todoList += "none\n"
99 | end
100 | todoList += "\n"
101 | end
102 |
103 | File.open($myPath + "/todoList.txt", "w") {|f|
104 | f << todoList}
105 |
106 | puts "GeekTool Updated."
107 |
108 | input
109 | none
110 | keyEquivalent
111 | ^G
112 | name
113 | Export to GeekTool
114 | output
115 | showAsTooltip
116 | scope
117 | text.html.markdown.wiki.gtd
118 | uuid
119 | 4BAA7812-3BED-4A7B-8292-08C17C935BD7
120 |
121 |
122 |
--------------------------------------------------------------------------------
/Support/gtd_functions.rb:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby18
2 |
3 | require "#{ENV['TM_SUPPORT_PATH']}/lib/textmate"
4 | require "erb"
5 | require "pp"
6 | include ERB::Util
7 |
8 | class ExList
9 | def initialize
10 | @values = []
11 | end
12 | def contains(test)
13 | found = true
14 | @values.each do |item|
15 | if test == item.chomp
16 | found = false
17 | end
18 | end
19 | return found
20 | end
21 | def add(item)
22 | @values.push item
23 | end
24 | def print
25 | puts @values
26 | end
27 | end
28 |
29 | def printTasks
30 |
31 | $myPath = ENV['TM_DIRECTORY']
32 | $tags = [] #user defined contexts
33 |
34 | def readContexts(a)
35 | # processes contexts.gtd into script
36 | context, tabCommand, tabString, regex, color = a.split(/\|/)
37 | if $exceptions == "some"
38 | if (context[0..2] != "+ ")
39 | $tags.push({:label => context[3..-1], :regexp => regex, :color => color, :matches => []})
40 | end
41 | elsif $exceptions == "full"
42 | if ((context[0..2] != "<- ") && (context[0..2] != "-> ") && (context[0..2] != "+ "))
43 | $tags.push({:label => context[3..-1], :regexp => regex, :color => color, :matches => []})
44 | end
45 | else
46 | $tags.push({:label => context[3..-1], :regexp => regex, :color => color, :matches => []})
47 | end
48 | end
49 |
50 |
51 | def TextMate.file_link (file, line = 0)
52 | return "txmt://open/?url=file://" + $myPath + "/" +
53 | file.gsub(/[^a-zA-Z0-9.-\/]/) { |m| sprintf("%%%02X", m[0]) } +
54 | ".gtd&line=" + line.to_s
55 | end
56 |
57 | # the contexts.gtd file is read, and converted into $contexts
58 | file = File.open($myPath+"/contexts.gtd", "r")
59 | file.each do |line|
60 | readContexts(line)
61 | end
62 |
63 | xFile = File.open($myPath+"/excluded.gtd", "r")
64 |
65 | myList = ExList.new
66 |
67 | xFile.each do |line|
68 | myList.add(line)
69 | end
70 |
71 | # sorting happens
72 | $todoList = ""
73 | $tags.each do |tag|
74 | context = tag[:regexp]
75 | matches = 0
76 | #puts context
77 | myFiles = Dir.entries($myPath)
78 | myFiles.each do |fileName|
79 | if ((fileName[-3,3] == "gtd") and myList.contains(fileName))
80 | lineno = 0
81 | mFile = File.open(fileName)
82 | mFile.each do |line|
83 | lineno = lineno + 1
84 | tLine = line[3..-1]
85 | if tLine != nil
86 | re = /\s/
87 | if (line[0..1] == "- " or line[0..1] == "! ")
88 | ctask = re.match(tLine)
89 | else
90 | ctask = re.match(line)
91 | end
92 | if (ctask.pre_match == context)
93 | results = {
94 | :file => fileName[0..-5],
95 | :line => lineno,
96 | :content => ctask.post_match
97 | }
98 | tag[:matches] << results
99 | $todoList += results.to_s
100 | matches += 1
101 | if matches == 1
102 | $todoList += tag[:label] + "\n"
103 | end
104 | end
105 | end
106 | end
107 | if matches == 0
108 | # todoList += "none\n"
109 | end
110 | $todoList += "\n"
111 | end
112 | end
113 | end
114 | if $exceptions == "some"
115 | File.open($myPath + "/todoList.txt", "w") {|f|
116 | f << $todoList}
117 | else
118 | tmpl_file = "#{ENV['TM_BUNDLE_SUPPORT']}/template.rhtml"
119 | puts ERB.new(File.open(tmpl_file), 0, '<>').result
120 | end
121 | end
122 |
123 | def displayTasks
124 | $exceptions = "full"
125 | printTasks
126 | end
127 |
128 | def displaySomeTasks
129 | $exceptions = "some"
130 | printTasks
131 | end
132 |
133 | def displayAllTasks
134 | $exceptions = false
135 | printTasks
136 | end
137 |
138 |
139 |
--------------------------------------------------------------------------------
/Commands/Help.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | . "$TM_SUPPORT_PATH/lib/webpreview.sh"
9 | html_header "GTD Bundle Help" "Getting Things Done"
10 | Markdown.pl <<"EOF"|SmartyPants.pl
11 |
12 | This bundle is shamelessly taken from the TODO bundle and reconfigured for GTD. [More information](http://www.davidco.com) on GTD.
13 |
14 | # Setting up the GTD Bundle
15 |
16 | The latest version of the GTD bundle can always be found at [textmate repository]. Additionally, you'll need two files, a contexts file and an exclusions file. These files need to go into a folder where you plan to place all of your .gtd files. I keep mine in `~/Documents/ToDo`.
17 |
18 | Basically, the `contexts.gtd` file is a list of contexts, as described above. There are several data elements for each file, a couple of which I no longer use, but keep so that I don't break the system. The big things to get right are the context (first cell), the shortcut key (second cell) and the context string (third element).
19 |
20 | The `exclusions.gtd` file is a list of gtd files that you *don't* want to see listed in the rollup of tasks. Why? Well, it allows me to create project files that I can hide until I want to deal with them. For example, I created a `bookshelf.gtd` file that lists all of the tasks associated with building shelves in my garage. However, I'm not ready for that project yet, so I hide it from my rollup. I've tried to make the GTD bundle as customizable as possible, so while you must have the `excluded.gtd` file, you are free to not use it.
21 |
22 | # Using the GTD Bundle
23 |
24 | Now that you have downloaded the bundle and the supporting files, you are ready to jump in! First, create a new project file in your ToDo folder (or whatever you call it). Then begin adding tasks by entering a shortcut and hitting the "**Enter**" key - not "Return." This should replace the shortcut with the corresponding context string from `contexts.gtd`. Then tab to the data field(s) for that task and hit return to finish entering the task.
25 |
26 | Contexts are great, but there is also a status component of the gtd list in the GTD bundle. The normal status is how the task is created. The two modified statuses are "WAIT" and "DONE." To change the status of a task to "WAIT" type "w" and then the tab key anywhere on the tasks line (just make sure it is either the first character or there is a pace in from of the "w"). Then, when you want to "unwait" the task, do the same thing with "u". When a task is done, mark it as "DONE" using "d" and the tab key.
27 |
28 | Like I said in the beginning, my objective is to plan in project, execute in context. So, I have a couple of list views, "Active GTD List View" and "GTD List View". The major difference between the two is that the active list does not show completed tasks, although it does show "WAIT" tasks. Either way, the bundle creates a nice looking list of tasks, arranged by context.
29 |
30 | One other subject area is additional list formatting. You can sort all of the tasks in a project by context by pressing `F5`. I personally don't like this, because my projects are generally built in a rough sequence. I have to look up a phone number before I can call it, for example. So, the feature is there, but I don't really use it. There are also a couple of cleanup commands. Cleanup (CTRL-Shift-C) moves all of the "DONE" tasks to the bottom of a project list. Remove (CTRL-ALT-Shift-C) does what it says; it removes completed tasks.
31 |
32 | EOF
33 | html_footer
34 |
35 | input
36 | none
37 | name
38 | Help
39 | output
40 | showAsHTML
41 | scope
42 | text.html.markdown.wiki.gtd
43 | uuid
44 | A6C302D1-4EB0-4CE8-AB43-F21672BFFB68
45 |
46 |
47 |
--------------------------------------------------------------------------------
/info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | contactEmailRot13
6 | nynfxnzvxr@tznvy.pbz
7 | contactName
8 | Mike Mellor
9 | deleted
10 |
11 | D7930433-37AF-412E-8B74-535C4E8BEDD3
12 | 8394A5AA-12B9-4DE6-9A48-C59C5B34FB58
13 | CC0A7C79-3116-4E03-AF68-B48B0EDB320F
14 | 1CEDBA1F-7419-468F-B1F2-1FEC80DA1F2F
15 | E3C0724D-3774-4B5C-B098-4179BE4A7B0F
16 | C917D47C-B986-4D44-BB69-53100AAE2D4C
17 | 3C05B507-FDF8-4BD1-9D9E-E1246C4AE7E4
18 | D9884663-4FA6-4272-B5E7-E9E554D302CA
19 | 98B494A9-BF8A-4645-A221-9FC47FE5E299
20 | 157FD2C3-5EE2-4062-AB10-4DC99569479A
21 | 0D2B01BF-7D4A-4DB4-B5DF-CD3C1448C02A
22 | E5F06D38-834F-47DA-8155-1442E93F916D
23 | 4FC43675-E2B2-44AA-9EBC-AE2467D1D206
24 |
25 | description
26 | Support for a variant of Getting Things Done.
27 | mainMenu
28 |
29 | items
30 |
31 | A7E8CB9F-F3E7-4FEE-BE5B-606EC30A8C6B
32 | F829378D-5E81-4B39-AC39-D1CCEBBB4A16
33 | 41849AE4-5AA4-453B-9077-BA31053CDFF2
34 | A6C302D1-4EB0-4CE8-AB43-F21672BFFB68
35 | 7FC498D7-1477-445B-A39B-FA63FDF10742
36 |
37 | submenus
38 |
39 | 41849AE4-5AA4-453B-9077-BA31053CDFF2
40 |
41 | items
42 |
43 | DC188528-1C29-47BA-9DBB-29A0C97C5655
44 | 0CE0800F-C66A-476A-B67A-5B22087D4E70
45 | D1E96B26-25A1-4525-873C-417598FB8814
46 | 8EF096F4-270F-493B-9091-D1266EB87AF5
47 |
48 | name
49 | Maintenance
50 |
51 | A7E8CB9F-F3E7-4FEE-BE5B-606EC30A8C6B
52 |
53 | items
54 |
55 | A108E6E4-317A-4883-B152-11A9E115BF1C
56 | 4351CBE0-CE02-472E-A0A9-F9F895B2946C
57 | 4BAA7812-3BED-4A7B-8292-08C17C935BD7
58 |
59 | name
60 | Views
61 |
62 | F829378D-5E81-4B39-AC39-D1CCEBBB4A16
63 |
64 | items
65 |
66 | 1CEC5F39-6479-4C96-BD24-EF49F0A19F9B
67 | 4BAAE940-7F72-4184-B165-F028FB6E99FF
68 | DCE997E1-D107-4873-A297-6CF808401DA3
69 | 4C31BAAA-2182-47D7-8B10-2B17A6078FCA
70 | 3EA8AD43-5ED3-4FB3-9296-D37A409AABF8
71 | 900C7391-7C63-4D1C-AF83-9F3E497F6A7F
72 |
73 | name
74 | Actions
75 |
76 |
77 |
78 | name
79 | GTD2
80 | ordering
81 |
82 | A984336E-2C65-4152-8FC0-34D2E73721DA
83 | 2417D353-C7F0-4F5C-9CA2-1294CBDC53A4
84 | A108E6E4-317A-4883-B152-11A9E115BF1C
85 | 4351CBE0-CE02-472E-A0A9-F9F895B2946C
86 | 4BAA7812-3BED-4A7B-8292-08C17C935BD7
87 | A6C302D1-4EB0-4CE8-AB43-F21672BFFB68
88 | 3EA8AD43-5ED3-4FB3-9296-D37A409AABF8
89 | 4BAAE940-7F72-4184-B165-F028FB6E99FF
90 | 4C31BAAA-2182-47D7-8B10-2B17A6078FCA
91 | DCE997E1-D107-4873-A297-6CF808401DA3
92 | 900C7391-7C63-4D1C-AF83-9F3E497F6A7F
93 | 0CE0800F-C66A-476A-B67A-5B22087D4E70
94 | 1CEC5F39-6479-4C96-BD24-EF49F0A19F9B
95 | DC188528-1C29-47BA-9DBB-29A0C97C5655
96 | D1E96B26-25A1-4525-873C-417598FB8814
97 | 8EF096F4-270F-493B-9091-D1266EB87AF5
98 | 7FC498D7-1477-445B-A39B-FA63FDF10742
99 |
100 | uuid
101 | 2C67AF8E-070F-438B-AB84-B0F9D6A7ABA0
102 |
103 |
104 |
--------------------------------------------------------------------------------
/Support/template.rhtml:
--------------------------------------------------------------------------------
1 | <%
2 |
3 | # $Revision: 624 $
4 |
5 | # FIXME Place named anchors in such a way that jumping to one does not crop the top part of the
.
6 | # TODO Try out PagePacker and adjust print styles accordingly, http://weblog.bignerdranch.com/?p=23
7 | # TODO Maybe remove project column from printed list views.
8 | # TODO Parse match[:content] and create txmt:// links to wiki pages if they exist.
9 |
10 | # [2007-06-30: REVISION 624]
11 | # [FIXED] Setting contexts inactive should work now.
12 | # [CHANGED] Project names are now hidden when the list view is printed.
13 | # [2007-06-08: REVISION 623]
14 | # [NEW] Tasks in inactive contexts are omitted from the list views. -- Inactive contexts are all those, which have their names added to "excluded.gtd"... entries present in "excluded.gtd", but prefixed with "#" are NOT treated at inactive, so you create blocks of contexts in "excluded.gtd" and easily enable or disable them.
15 | # [NEW] Links contained in task descriptions are now clickable in the list views.
16 |
17 | # ----------------------------------------------------------------------------
18 |
19 | require 'digest/md5'
20 |
21 | excluded_contexts = []
22 | File.readlines(File.join(ENV['TM_DIRECTORY'], 'excluded.gtd')).each do |line|
23 | next if line.match(/^\s*#/) or line.match(/^\s*$/)
24 | excluded_contexts << line if !File.exist?(File.join(ENV['TM_DIRECTORY'], line.strip!))
25 | end
26 |
27 | link_pattern = Regexp.new('(((https?|s?ftp|ftps|file|smb|afp|nfs|(x-)?man|gopher|x-yojimbo-item|txmt)://|mailto:)[-:@a-zA-Z0-9_.~%+/?=]+)')
28 | wiki_pattern = Regexp.new('([A-Z][a-z]+([A-Z][a-z]*)+)')
29 |
30 | no_actions = true
31 | $tags.each do |tag|
32 | tag[:label].strip!
33 | tag[:excluded] = excluded_contexts.include?(tag[:label])
34 | tag[:hashed_label] = 'x' + Digest::MD5.hexdigest(tag[:label])
35 | tag[:escaped_label] = html_escape(tag[:label]).strip
36 | unless tag[:matches].empty? or tag[:excluded]
37 | no_actions = false
38 | count = 0
39 | tag[:matches].each do |match|
40 | match[:class] = (((count+=1) % 2) == 0) ? 'even' : 'odd'
41 | match[:escaped_file] = html_escape(File.basename(match[:file])).strip
42 | match[:escaped_content] = html_escape(match[:content]).strip
43 | match[:escaped_content].gsub!(link_pattern, '\1')
44 | end
45 | end
46 | end
47 |
48 | %>
50 |
51 |
52 |
53 | GTD2 List
54 |
61 |
192 |
269 |
270 |
271 |
272 |
273 |
274 | GTD2 List
275 |
276 | Contexts
277 |
278 | <% $tags.each do |tag| %>
279 | <% next if tag[:excluded] %>
280 | <% chunk = tag[:matches].empty? ? tag[:escaped_label] : "#{tag[:escaped_label]}" %>
281 | - <%= chunk %> (<%= tag[:matches].length %>)
282 | <% end %>
283 |
284 |
285 | Actions
286 | <%= Time.now.strftime('%A, %B %d, %Y – %H:%M, %Z') %>
287 |
288 | <% if no_actions %>
289 | | Wow, no unfinished tasks in any of your active projects and contexts! |
290 | <% else no_actions %>
291 | <% $tags.each do |tag| %>
292 | <% unless tag[:matches].empty? or tag[:excluded] %>
293 |
294 | | <%= tag[:escaped_label] %>
295 | (<%= tag[:matches].length %>)
296 | ⇧ |
297 |
298 | <% tag[:matches].each do |match| %>
299 |
300 | | <%= match[:escaped_file] %>, #<%= match[:line] %> |
301 | |
302 | <%= match[:escaped_content] %> |
303 |
304 | <% end %>
305 | <% end %>
306 | <% end %>
307 | <% end %>
308 |
309 |
310 |
311 |
312 |
--------------------------------------------------------------------------------
|