dto-org-gtd.el 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. ;;; dto-org-gtd.el --- dto's org-mode configuration for GTD
  2. ;; Copyright (C) 2007 David O'Toole
  3. ;; Author: David O'Toole(require 'org) <dto@gnu.org>
  4. ;; Keywords: tools
  5. ;; This file is free software; you can redistribute it and/or modify
  6. ;; it under the terms of the GNU General Public License as published by
  7. ;; the Free Software Foundation; either version 3, or (at your option)
  8. ;; any later version.
  9. ;; This file is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;; GNU General Public License for more details.
  13. ;; You should have received a copy of the GNU General Public License
  14. ;; along with GNU Emacs; see the file COPYING. If not, write to
  15. ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  16. ;; Boston, MA 02110-1301, USA.
  17. ;;; Commentary:
  18. ;; There are several articles about using GTD (GettingThingsDone) with
  19. ;; OrgMode. I'm publishing mine as an Emacs Lisp source
  20. ;; file.
  21. ;; This is a very basic example org-and-gtd setup. It's also my real
  22. ;; configuration, so you can load it yourself or just take a few
  23. ;; pieces.
  24. ;;; Code:
  25. (require 'org)
  26. (require 'remember)
  27. ;; I have a nice Wacom tablet, so I like to use the mouse. Org-mouse
  28. ;; adds various clickable menus to org-mode constructs.
  29. (require 'org-mouse)
  30. ;; I want files with the extension ".org" to open in org-mode.
  31. (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
  32. ;; I keep almost everything in one big org file.
  33. (defvar org-gtd-file "~/gtd.org")
  34. ;; I open my gtd file when I hit C-c g
  35. (defun gtd ()
  36. "Open the GTD file."
  37. (interactive)
  38. (find-file org-gtd-file))
  39. ;; Some basic keybindings.
  40. (global-set-key "\C-cl" 'org-store-link)
  41. (global-set-key "\C-ca" 'org-agenda)
  42. (global-set-key "\C-cr" 'org-remember)
  43. (global-set-key "\C-cg" 'gtd)
  44. ;; This seems like a good basic set of keywords to start out with:
  45. (setq org-todo-keywords '((type "TODO" "NEXT" "WAITING" "DONE")))
  46. ;; Some projects need their own org files, but I still want them to
  47. ;; show up in my agenda.
  48. (defvar org-gtd-other-files)
  49. (setf org-gtd-other-files (list "~/eon/eon.org"))
  50. (setf org-agenda-files (cons org-gtd-file org-gtd-other-files))
  51. ;; When I'm using org to track issues in a project, I use these
  52. ;; keywords on a file-local basis:
  53. ;; #+SEQ_TODO: TODO | DONE
  54. ;; #+SEQ_TODO: REPORT BUG KNOWNCAUSE | FIXED
  55. ;; #+SEQ_TODO: | CANCELLED
  56. ;; The lisp version is:
  57. ;; (setq org-todo-keywords '((sequence "TODO" | "DONE")
  58. ;; (sequence "REPORT" "BUG" "KNOWNCAUSE" | "FIXED")
  59. ;; (sequence | "CANCELLED")))
  60. ;; Easy basic searches. Get a quick view of nextactions, etc
  61. (setq org-agenda-custom-commands
  62. '(("w" todo "WAITING" nil)
  63. ("n" todo "NEXT" nil)
  64. ("d" "Agenda + Next Actions" ((agenda) (todo "NEXT")))))
  65. ;; I use org's tag feature to implement contexts.
  66. (setq org-tag-alist '(("STUDIO" . ?s)
  67. ("COMPUTER" . ?c)
  68. ("MAIL" . ?m)
  69. ("HOME" . ?h)
  70. ("FIELD" . ?f)
  71. ("READING" . ?r)
  72. ("DVD" . ?d)))
  73. ;; I like to color-code task types.
  74. (setf org-todo-keyword-faces '(("NEXT" . (:foreground "yellow" :background "red" :bold t :weight bold))
  75. ("TODO" . (:foreground "cyan" :background "steelblue" :bold t :weight bold))
  76. ("WAITING" . (:foreground "yellow" :background "magenta2" :bold t :weight bold))
  77. ("DONE" . (:foreground "gray50" :background "gray30"))))
  78. ;; I put the archive in a separate file, because the gtd file will
  79. ;; probably already get pretty big just with current tasks.
  80. (setq org-archive-location "%s_archive::")
  81. ;; Remember support. This creates several files:
  82. ;;
  83. ;; ~/todo.org Where remembered TODO's are stored.
  84. ;; ~/journal.org Timestamped journal entries.
  85. ;; ~/remember.org All other notes
  86. ;; and a keybinding of "C-c r" for making quick notes from any buffer.
  87. ;; These bits of Remembered information must eventually be reviewed
  88. ;; and filed somewhere (perhaps in gtd.org, or in a project-specific
  89. ;; org file.) The out-of-sight, out-of-mind rule applies here---if I
  90. ;; don't review these auxiliary org-files, I'll probably forget what's
  91. ;; in them.
  92. (require 'remember)
  93. (setq org-reverse-note-order t) ;; note at beginning of file by default.
  94. (setq org-default-notes-file "~/remember.org")
  95. (setq remember-annotation-functions '(org-remember-annotation))
  96. (setq remember-handler-functions '(org-remember-handler))
  97. (add-hook 'remember-mode-hook 'org-remember-apply-template)
  98. (setq org-remember-templates
  99. '((?t "* TODO %?\n %i\n %a" "~/todo.org")
  100. (?j "* %U %?\n\n %i\n %a" "~/journal.org")
  101. (?i "* %^{Title}\n %i\n %a" "~/remember.org" "New Ideas")))
  102. (global-set-key "\C-cr" 'org-remember)
  103. (global-set-key [(f12)] 'org-remember)
  104. ;; My preferences. These are less related to GTD, and more to my
  105. ;; particular setup. They are included here for completeness, and so
  106. ;; that new org users can see a complete example org-gtd
  107. ;; configuration.
  108. (setq org-return-follows-link t)
  109. (setq org-hide-leading-stars t)
  110. (setf org-tags-column -65)
  111. (setf org-special-ctrl-a/e t)
  112. (setq org-log-done t)
  113. (setq org-deadline-warning-days 14)
  114. (setq org-fontify-emphasized-text t)
  115. (setq org-fontify-done-headline t)
  116. (setq org-agenda-include-all-todo nil)
  117. (setq org-directory "~/")
  118. (setq org-export-html-style "<link rel=stylesheet href=\"../e/freeshell2.css\" type=\"text/css\">")
  119. (setq org-export-with-section-numbers nil)
  120. (setq org-export-with-toc nil)
  121. (setq org-adapt-indentation nil)
  122. ;; widen category field a little
  123. (setq org-agenda-prefix-format " %-17:c%?-12t% s")
  124. ;; fix new keybinding that clobbers mine
  125. (add-hook 'org-mode-hook (lambda ()
  126. (local-set-key [(control tab)] 'other-window)))
  127. (provide 'org-gtd)
  128. ;;; org-gtd.el ends here