4 ;; refer http://doc.norang.ca/org-mode.html
6 ;(add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
7 (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
10 ;; Standard key bindings
11 (global-set-key "\C-cl" 'org-store-link)
12 (global-set-key "\C-ca" 'org-agenda)
13 (global-set-key "\C-cb" 'org-iswitchb)
16 ;;(add-hook 'org-mode-hook
18 ;; (org-set-local 'yas/trigger-key [tab])
19 ;; (define-key yas/keymap [tab] 'yas/next-field-or-maybe-expand)))
26 ;; define more state of todo
27 (setq org-todo-keywords
28 (quote ((sequence "TODO(t)" "STARTED(s)" "|" "DONE(d)")
29 (sequence "WAITING(w@/!)" "HOLD(h@/!)" "|" "CANCELLED(c@/!)" ))))
31 (setq org-todo-keyword-faces
32 (quote (("TODO" :foreground "red" :weight bold)
33 ("NEXT" :foreground "blue" :weight bold)
34 ("DONE" :foreground "forest green" :weight bold)
35 ("WAITING" :foreground "orange" :weight bold)
36 ("HOLD" :foreground "magenta" :weight bold)
37 ("CANCELLED" :foreground "forest green" :weight bold)
38 ("MEETING" :foreground "forest green" :weight bold)
39 ("PHONE" :foreground "forest green" :weight bold))))
41 (setq org-use-fast-todo-selection t)
43 ;; allow S-left/right to rotate state not set timestamp and add note
44 (setq org-treat-S-cursor-todo-selection-as-state-change nil)
46 ;; trigger a tags for the task when changing state
47 (setq org-todo-state-tags-triggers
48 (quote (("CANCELLED" ("CANCELLED" . t))
49 ("WAITING" ("WAITING" . t))
50 ("HOLD" ("WAITING") ("HOLD" . t))
51 (done ("WAITING") ("HOLD"))
52 ("TODO" ("WAITING") ("CANCELLED") ("HOLD"))
53 ("NEXT" ("WAITING") ("CANCELLED") ("HOLD"))
54 ("DONE" ("WAITING") ("CANCELLED") ("HOLD")))))
58 (setq org-directory "~/Private/org")
59 (setq org-default-notes-file (concat org-directory "/notes.org"))
60 (define-key global-map "\C-cc" 'org-capture)
63 (setq org-refile-targets (quote ((nil :maxlevel . 9)
64 (org-agenda-files :maxlevel . 9))))
69 ;; Capture templates for: TODO tasks, Notes, appointments, phone calls, meetings, and org-protocol
70 ;(setq org-capture-templates
71 ; (quote (("t" "todo" entry (file "~/git/org/refile.org")
72 ; "* TODO %?\n%U\n%a\n" :clock-in t :clock-resume t)
73 ; ("r" "respond" entry (file "~/git/org/refile.org")
74 ; "* NEXT Respond to %:from on %:subject\nSCHEDULED: %t\n%U\n%a\n" :clock-in t :clock-resume t :immediate-finish t)
75 ; ("n" "note" entry (file "~/git/org/refile.org")
76 ; "* %? :NOTE:\n%U\n%a\n" :clock-in t :clock-resume t)
77 ; ("j" "Journal" entry (file+datetree "~/git/org/diary.org")
78 ; "* %?\n%U\n" :clock-in t :clock-resume t)
79 ; ("w" "org-protocol" entry (file "~/git/org/refile.org")
80 ; "* TODO Review %c\n%U\n" :immediate-finish t)
81 ; ("m" "Meeting" entry (file "~/git/org/refile.org")
82 ; "* MEETING with %? :MEETING:\n%U" :clock-in t :clock-resume t)
83 ; ("p" "Phone call" entry (file "~/git/org/refile.org")
84 ; "* PHONE %? :PHONE:\n%U" :clock-in t :clock-resume t)
85 ; ("h" "Habit" entry (file "~/git/org/refile.org")
86 ; "* NEXT %?\n%U\n%a\nSCHEDULED: %(format-time-string \"%<<%Y-%m-%d %a .+1d/3d>>\")\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n"))))
90 ; Tags with fast selection keys
91 (setq org-tag-alist (quote ((:startgroup)
109 ; Allow setting single tags without the menu
110 (setq org-fast-tag-selection-single-key (quote expert))
112 ; For tag searches ignore tasks with scheduled and deadline dates
113 (setq org-agenda-tags-todo-honor-ignore-options t)
116 ;; Always hilight the current agenda line
117 (add-hook 'org-agenda-mode-hook
118 '(lambda () (hl-line-mode 1))
123 ;; The following custom-set-faces create the highlights
125 ;; custom-set-faces was added by Custom.
126 ;; If you edit it by hand, you could mess it up, so be careful.
127 ;; Your init file should contain only one such instance.
128 ;; If there is more than one, they won't work right.
129 '(org-mode-line-clock ((t (:background "grey75" :foreground "red" :box (:line-width -1 :style released-button)))) t))