.emacs.orgconf.el 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. (setq org-agenda-files '("~/org/capture.org" "~/org/main.org"))
  2. (setq org-agenda-include-diary t)
  3. (setq org-capture-templates
  4. '(("G" "Define a goal" entry
  5. (file+headline "~/org/capture.org" "Capture")
  6. (file "~/org/tpl/tpl_goal.txt") :empty-lines-after 2)
  7. ("N" "NEXT entry" entry
  8. (file+headline "~/org/capture.org" "Capture")
  9. (file "~/org/tpl/tpl_next.txt") :empty-lines-before 1)
  10. ("T" "TODO entry" entry
  11. (file+headline "~/org/capture.org" "Capture")
  12. (file "~/org/tpl/tpl_todo.txt") :empty-lines-before 1)
  13. ("W" "WAITING entry" entry
  14. (file+headline "~/org/capture.org" "Capture")
  15. (file "~/org/tpl/tpl_waiting.txt") :empty-lines-before 1)
  16. ("S" "SOMEDAY entry" entry
  17. (file+headline "~/org/capture.org" "Capture")
  18. (file "~/org/tpl/tpl_someday.txt") :empty-lines-before 1)
  19. ("P" "PROJ entry" entry
  20. (file+headline "~/org/capture.org" "Capture")
  21. (file "~/org/tpl/tpl_proj.txt") :empty-lines-before 1)
  22. ("B" "Book on the to-read-list" entry
  23. (file+headline "~/org/main.org" "Books to read")
  24. (file "~/org/tpl/tpl_book.txt") :empty-lines-after 2)
  25. ("D" "Add a daily plan checklist" entry
  26. (file+olp+datetree "~/org/daily_plan.org")
  27. (file "~/org/tpl/tpl_daily_plan.txt"))
  28. ("n" "Note" entry
  29. (file+headline "~/org/notes.org" "Random Notes") "** %?"
  30. :empty-lines 0)
  31. ("J" "Add a journal entry" entry
  32. (file+olp+datetree "~/org/journal.org")
  33. "* %<%H:%M> - %^{Activity}\12%?")
  34. ("w" "Add 10 I wants" entry
  35. (file+olp+datetree "~/org/wants.org") "* %<%H:%M>\0121. %?")
  36. ("b" "Add an item to buy" entry
  37. (file+headline "~/org/main.org" "Wish List")
  38. (file "~/org/tpl/tpl_wishlist.txt") :empty-lines-before 1)))
  39. (setq org-clock-into-drawer "CLOCKING")
  40. (setq org-enforce-todo-checkbox-dependencies t)
  41. (setq org-enforce-todo-dependencies t)
  42. (setq org-hide-emphasis-markers t)
  43. (setq org-hide-leading-stars t)
  44. (setq org-log-into-drawer t)
  45. (setq org-log-repeat nil)
  46. (setq org-log-reschedule 'note)
  47. (setq org-modules
  48. '(ol-bbdb ol-bibtex ol-docview ol-doi ol-eww ol-gnus org-habit ol-info
  49. ol-irc ol-mhe ol-rmail ol-w3m))
  50. (setq org-refile-allow-creating-parent-nodes 'confirm)
  51. (setq org-refile-targets '((org-agenda-files :maxlevel . 2)))
  52. (setq org-startup-folded 'content)
  53. (setq org-startup-indented t)
  54. (defun my/copy-idlink-to-clipboard() "Copy an ID link with the
  55. headline to killring, if no ID is there then create a new unique
  56. ID. This function works only in org-mode or org-agenda buffers.
  57. The purpose of this function is to easily construct id:-links to
  58. org-mode items. If its assigned to a key it saves you marking the
  59. text and copying to the killring."
  60. (interactive)
  61. (when (eq major-mode 'org-agenda-mode) ;if we are in agenda mode we switch to orgmode
  62. (org-agenda-show)
  63. (org-agenda-goto))
  64. (when (eq major-mode 'org-mode) ; do this only in org-mode buffers
  65. (setq mytmphead (nth 4 (org-heading-components)))
  66. (setq mytmpid (funcall 'org-id-get-create))
  67. (setq mytmplink (format "[[id:%s][%s]]" mytmpid mytmphead))
  68. (kill-new mytmplink)
  69. (message "Copied %s to killring (clipboard)" mytmplink)
  70. ))
  71. (global-set-key (kbd "<f5>") 'my/copy-idlink-to-clipboard)
  72. (defun org-reset-checkbox-state-maybe ()
  73. "Reset all checkboxes in an entry if the `RESET_CHECK_BOXES' property is set"
  74. (interactive "*")
  75. (if (org-entry-get (point) "RESET_CHECK_BOXES")
  76. (org-reset-checkbox-state-subtree)))
  77. (defun org-checklist ()
  78. (when (member org-state org-done-keywords) ;; org-state dynamically bound in org.el/org-todo
  79. (org-reset-checkbox-state-maybe)))
  80. (add-hook 'org-after-todo-state-change-hook 'org-checklist)
  81. (setq org-todo-keywords
  82. '((sequence "REPEAT(r)" "NEXT(n@/!)" "TODO(t@/!)" "WAITING(w@/!)" "SOMEDAY(s@/!)" "PROJ(p)" "|" "DONE(d@)" "CANCELLED(c@)")
  83. (sequence "GOAL(g)" "|" "ACHIEVED(a@)" "MISSED(m@)")
  84. ))
  85. ;; TODO colors
  86. (setq org-todo-keyword-faces
  87. '(
  88. ("TODO" . (:foreground "GoldenRod" :weight bold))
  89. ("NEXT" . (:foreground "DeepPink" :weight bold))
  90. ("WAITING" . (:foreground "dim gray" :weight bold))
  91. ("REPEAT" . (:foreground "DarkOrange" :weight bold))
  92. ("PROJ" . (:foreground "Red" :weight bold))
  93. ("SOMEDAY" . (:foreground "chocolate" :weight bold))
  94. ("DONE" . (:foreground "LimeGreen" :weight bold))
  95. ("CANCELLED" . (:foreground "LimeGreen" :weight bold))
  96. ("GOAL" . (:foreground "deep sky blue" :weight bold))
  97. ("ACHIEVED" . (:foreground "green" :weight bold))
  98. ("MISSED" . (:foreground "saddle brown" :weight bold))
  99. ))
  100. ;;org Tags
  101. (setq org-tag-alist '(("BOOK" . ?b)))
  102. ;; Tag colors
  103. (setq org-tag-faces
  104. '(
  105. ("BOOK" . (:foreground "mediumPurple1" :weight bold))
  106. ("NEW" . (:foreground "royalblue1" :weight bold))
  107. )
  108. )
  109. (global-set-key (kbd "C-c a") 'org-agenda)
  110. (global-set-key (kbd "<f6>") 'org-capture)