rename old emacs folder
[dotfiles.git] / emacs.d_old / elisp / init-org.el
1
2
3 ;; http://doc.norang.ca/org-mode.html  Org Mode - Organize Your Life In Plain Text!
4
5 (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
6
7 ;;; better map to M-c instead of C-c, since M-c is more easy
8 ;;(global-set-key "M-cqc" 'org-capture) or M-o c
9 (global-set-key "\C-cl" 'org-store-link)
10 (global-set-key "\C-ca" 'org-agenda)
11 (global-set-key "\C-cb" 'org-iswitchb)
12
13
14 ;; better use hydra define these
15 (global-unset-key "\M-o")
16 (global-set-key (kbd "M-o a") 'org-agenda)
17 (global-set-key (kbd "M-o b") 'org-iswitchb)
18 (global-set-key (kbd "M-o c") 'org-capture)
19
20
21 (global-set-key (kbd "<f12>") 'org-agenda)
22
23 (setq org-agenda-files (quote ("~/Private/org")))
24
25 (setq org-todo-keywords
26       (quote ((sequence "TODO(t)" "ONGOING(n)" "|" "DONE(d)")
27               (sequence "WAITING(w@/!)" "HOLD(h@/!)" "|" "CANCELLED(c@/!)" ))))
28
29 (setq org-todo-keyword-faces
30       (quote (("TODO" :foreground "red" :weight bold)
31               ("ONGOING" :foreground "blue" :weight bold)
32               ("DONE" :foreground "forest green" :weight bold)
33               ("WAITING" :foreground "orange" :weight bold)
34               ("HOLD" :foreground "magenta" :weight bold)
35               ("CANCELLED" :foreground "forest green" :weight bold))))
36
37 (setq org-todo-state-tags-triggers
38       (quote (("CANCELLED" ("CANCELLED" . t))
39               ("WAITING" ("WAITING" . t))
40               ("HOLD" ("WAITING") ("HOLD" . t))
41               (done ("WAITING") ("HOLD"))
42               ("TODO" ("WAITING") ("CANCELLED") ("HOLD"))
43               ("ONGOING" ("WAITING") ("CANCELLED") ("HOLD"))
44               ("DONE" ("WAITING") ("CANCELLED") ("HOLD")))))
45
46 ;; change a task state C-c C-t Key
47 (setq org-use-fast-todo-selection t)
48 (setq org-treat-S-cursor-todo-selection-as-state-change nil)
49
50
51
52 ;; Org Capture
53 (setq org-directory "~/Private/org/")
54 (setq org-default-notes-file (concat org-directory "refile.org"))
55 (setq org-default-diary-file (concat org-directory "diary.org"))
56
57 (global-set-key (kbd "C-c c") 'org-capture)
58
59 ;; Capture templates for: TODO tasks, Notes, appointments, phone calls, meetings, and org-protocol
60 (setq org-capture-templates
61       (quote (("t" "Todo" entry (file org-default-notes-file)
62                "* TODO %?\n\n  %U\n  %a\n" :clock-in t :clock-resume t)
63               ("r" "Respond" entry (file org-default-notes-file)
64                "* NEXT Respond to %:from on %:subject\nSCHEDULED: %t\n  %U\n  %a\n" :clock-in t :clock-resume t :immediate-finish t)
65               ("n" "Note" entry (file org-default-notes-file)
66                "* %? :NOTE:\n\n  %U\n  %a\n" :clock-in t :clock-resume t)
67               ("j" "Journal" entry (file+datetree org-default-diary-file)
68                "* %?\n%U\n" :clock-in t :clock-resume t)
69               ("w" "Org-protocol" entry (file org-default-notes-file)
70                "* TODO Review %c\n%U\n" :immediate-finish t)
71               ("m" "Meeting" entry (file org-default-notes-file)
72                "* MEETING with %? :MEETING:\n%U" :clock-in t :clock-resume t)
73               ("p" "Phone call" entry (file org-default-notes-file)
74                "* PHONE %? :PHONE:\n  %U" :clock-in t :clock-resume t)
75               ("h" "Habit" entry (file org-default-notes-file)
76                "* NEXT %?\n\n  %U\n  %a\n\nSCHEDULED: %(format-time-string \"%<<%Y-%m-%d %a .+1d/3d>>\")\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n"))))
77
78
79 (provide 'init-org)