|
| 1 | +;; -*- lexical-binding: t; -*- |
| 2 | +(setq imi-gtd-path "~/pkm-roam/roam2/gtd/") |
| 3 | +(setq imi-gtd-inbox-file (concat imi-gtd-path "inbox.org")) |
| 4 | +(setq imi-gtd-tickler-file (concat imi-gtd-path "tickler.org")) |
| 5 | +(setq imi-gtd-someday-file (concat imi-gtd-path "someday.org")) |
| 6 | +(setq imi-gtd-gtd-file (concat imi-gtd-path "gtd.org")) |
| 7 | +(setq imi-gtd-reference-file (concat imi-gtd-path "reference.org")) |
| 8 | + |
| 9 | +(defun open-gtd-dir() (interactive) (find-file imi-gtd-gtd-file)) |
| 10 | +(global-set-key (kbd "<f6>") 'open-gtd-dir) |
| 11 | + |
| 12 | +;; 定义 org-capture 模版 |
| 13 | +(setq org-capture-templates '(("t" "Todo [inbox]" entry |
| 14 | + (file+headline imi-gtd-inbox-file "Tasks") |
| 15 | + "* TODO %i%?") |
| 16 | + ("T" "Tickler" entry |
| 17 | + (file+headline imi-gtd-tickler-file "Tickler") |
| 18 | + "* %i%? \n %U") |
| 19 | + )) |
| 20 | + |
| 21 | + |
| 22 | +;; 定义触发 capture inbox 的快捷键 |
| 23 | +(define-key global-map (kbd "C-c j t") (lambda () (interactive) (org-capture nil "t"))) |
| 24 | +;; 定义触发 capture Tickler 的快捷键 |
| 25 | +(define-key global-map (kbd "C-c j T") (lambda () (interactive) (org-capture nil "T"))) |
| 26 | +;; 归档 |
| 27 | +(define-key global-map (kbd "C-c j a") 'org-archive-subtree-default) |
| 28 | + |
| 29 | +;; Save Org buffers after refiling! |
| 30 | +(advice-add 'org-refile :after 'org-save-all-org-buffers) |
| 31 | +(setq org-refile-targets '((imi-gtd-gtd-file :maxlevel . 3) |
| 32 | + (imi-gtd-someday-file :level . 1) |
| 33 | + (imi-gtd-tickler-file :maxlevel . 2) |
| 34 | + (imi-gtd-reference-file :maxlevel . 2) |
| 35 | + )) |
| 36 | + |
| 37 | +(setq org-todo-keywords '((sequence "TODO(t)" "WAITING(w)" "|" "DONE(d)" "CANCELLED(c)"))) |
| 38 | + |
| 39 | +(setq org-agenda-files (list imi-gtd-inbox-file imi-gtd-gtd-file imi-gtd-tickler-file)) |
| 40 | + |
| 41 | +(setq org-agenda-custom-commands |
| 42 | + '(("o" "At the office" tags-todo "@office" |
| 43 | + ((org-agenda-overriding-header "Office"))))) |
| 44 | + |
| 45 | + |
| 46 | +(provide 'init-gtd) |
0 commit comments