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