Emacs personal configuration
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

162 Zeilen
5.4KB

  1. ;;; package --- Org mode configuration
  2. ;;; Commentary:
  3. ;;; see: http://doc.norang.ca/org-mode.html
  4. ;;; Code
  5. (when (< emacs-major-version 24)
  6. (require-package 'org))
  7. (require-package 'org-plus-contrib)
  8. (define-key global-map (kbd "C-c l") 'org-store-link)
  9. (define-key global-map (kbd "C-c a") 'org-agenda)
  10. (define-key global-map (kbd "C-c b") 'org-iswitchb)
  11. ;; Various preferences
  12. (setq org-log-done t
  13. org-completion-use-ido t
  14. org-edit-timestamp-down-means-later t
  15. org-agenda-start-on-weekday nil
  16. org-agenda-span 14
  17. org-agenda-include-diary t
  18. org-agenda-window-setup 'current-window
  19. org-fast-tag-selection-single-key 'expert
  20. org-html-validation-link nil
  21. org-export-kill-product-buffer-when-displayed t
  22. org-tags-column 80)
  23. ;; all files in this directories will contribute to the agenda
  24. (setq org-agenda-files (quote ("~/Documents/org"
  25. "~/org")))
  26. ;;(add-to-list 'org-agenda-custom-commands
  27. ;; '("W" "Weekly review"
  28. ;; agenda ""
  29. ;; ((org-agenda-start-day "-7d")
  30. ;; (org-agenda-span 14)
  31. ;; (org-agenda-start-on-weekday 1))))
  32. ; Refile targets include this file and any file contributing to the agenda - up to 5 levels deep
  33. (setq org-refile-targets (quote ((nil :maxlevel . 5) (org-agenda-files :maxlevel . 5))))
  34. ; Targets start with the file name - allows creating level 1 tasks
  35. (setq org-refile-use-outline-path (quote file))
  36. ; Targets complete in steps so we start with filename, TAB shows the next level of targets etc
  37. (setq org-outline-path-complete-in-steps t)
  38. (setq org-todo-keywords
  39. (quote ((sequence "TODO(t)" "NEXT(n)" "STARTED(s)" "|" "DONE(d!/!)")
  40. (sequence "WAITING(w@/!)" "SOMEDAY(S)" "|" "CANCELLED(c@/!)" "MEETING"))))
  41. (setq org-todo-keyword-faces
  42. (quote (("TODO" :foreground "red" :weight bold)
  43. ("NEXT" :foreground "blue" :weight bold)
  44. ("STARTED" :foreground "yellow" :weight bold)
  45. ("DONE" :foreground "forest green" :weight bold)
  46. ("WAITING" :foreground "orange" :weight bold)
  47. ("SOMEDAY" :foreground "magenta" :weight bold)
  48. ("CANCELLED" :foreground "forest green" :weight bold)
  49. ("MEETING" :foreground "forest green" :weight bold))))
  50. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  51. ;; Org clock
  52. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  53. ;; Save the running clock and all clock history when exiting Emacs, load it on startup
  54. (setq org-clock-persistence-insinuate t)
  55. (setq org-clock-persist t)
  56. (setq org-clock-in-resume t)
  57. ;; Change task state to STARTED when clocking in
  58. (setq org-clock-in-switch-to-state "STARTED")
  59. ;; Save clock data and notes in the LOGBOOK drawer
  60. (setq org-clock-into-drawer t)
  61. ;; Removes clocked tasks with 0:00 duration
  62. (setq org-clock-out-remove-zero-time-clocks t)
  63. ;; Show clock sums as hours and minutes, not "n days" etc.
  64. (setq org-time-clocksum-format
  65. '(:hours "%d" :require-hours t :minutes ":%02d" :require-minutes t))
  66. ;; Show the clocked-in task - if any - in the header line
  67. (defun sanityinc/show-org-clock-in-header-line ()
  68. (setq-default header-line-format '((" " org-mode-line-string " "))))
  69. (defun sanityinc/hide-org-clock-from-header-line ()
  70. (setq-default header-line-format nil))
  71. (add-hook 'org-clock-in-hook 'sanityinc/show-org-clock-in-header-line)
  72. (add-hook 'org-clock-out-hook 'sanityinc/hide-org-clock-from-header-line)
  73. (add-hook 'org-clock-cancel-hook 'sanityinc/hide-org-clock-from-header-line)
  74. (after-load 'org-clock
  75. (define-key org-clock-mode-line-map [header-line mouse-2] 'org-clock-goto)
  76. (define-key org-clock-mode-line-map [header-line mouse-1] 'org-clock-menu))
  77. (require-package 'org-pomodoro)
  78. (after-load 'org-agenda
  79. (define-key org-agenda-mode-map (kbd "P") 'org-pomodoro))
  80. (after-load 'org
  81. (define-key org-mode-map (kbd "C-M-<up>") 'org-up-element))
  82. ;; https://superuser.com/a/570655/683536
  83. ;; Previously bound to org-fill-paragraph
  84. ;;(define-key org-mode-map "\M-q" 'toggle-truncate-lines)
  85. (after-load 'org
  86. (define-key org-mode-map (kbd "M-q") 'toggle-truncate-lines))
  87. (after-load 'org
  88. (org-babel-do-load-languages
  89. 'org-babel-load-languages
  90. '((R . t)
  91. (ditaa . t)
  92. (dot . t)
  93. (emacs-lisp . t)
  94. (gnuplot . t)
  95. (haskell . t)
  96. (latex . t)
  97. (ledger . t)
  98. (ocaml . nil)
  99. (octave . t)
  100. (python . t)
  101. (ruby . t)
  102. (screen . nil)
  103. (shell . t)
  104. (sql . t)
  105. (sqlite . t))))
  106. ;;
  107. ;; http://pragmaticemacs.com/emacs/org-mode-basics-vii-a-todo-list-with-schedules-and-deadlines/
  108. ;; http://pragmaticemacs.com/emacs/master-your-inbox-with-mu4e-and-org-mode/
  109. ;;capture todo items using C-c c t
  110. (define-key global-map (kbd "C-c c") 'org-capture)
  111. (setq org-capture-templates
  112. '(("t" "todo" entry (file+headline "~/Documents/org/main.org" "Tasks")
  113. "* TODO [#A] %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n%a\n")
  114. ("c" "crypto journal"
  115. entry (file+datetree "~/Documents/criptochuflas/_notes/crypto_journal.org")
  116. "* entry")
  117. ("d" "day time track"
  118. entry (file+datetree "~/Documents/org/time_tracker.org")
  119. "***
  120. **** Work
  121. ***** Keybase and catch up
  122. ***** Meetings:
  123. ***** Meta: check-ins
  124. **** Rest
  125. **** Eat
  126. ***** Lunch
  127. ***** Dinner
  128. **** Kids
  129. ***** Morning
  130. ***** Afternoon
  131. ***** Evening
  132. **** Workout
  133. **** Errands
  134. **** Learn
  135. ")))
  136. (provide 'init-org)
  137. ;;; init-org.el ends here