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.

128 Zeilen
4.3KB

  1. (when (< emacs-major-version 24)
  2. (require-package 'org))
  3. (require-package 'org-plus-contrib)
  4. (define-key global-map (kbd "C-c l") 'org-store-link)
  5. (define-key global-map (kbd "C-c a") 'org-agenda)
  6. ;; Various preferences
  7. (setq org-log-done t
  8. org-completion-use-ido t
  9. org-edit-timestamp-down-means-later t
  10. org-agenda-start-on-weekday nil
  11. org-agenda-span 14
  12. org-agenda-include-diary t
  13. org-agenda-window-setup 'current-window
  14. org-fast-tag-selection-single-key 'expert
  15. org-html-validation-link nil
  16. org-export-kill-product-buffer-when-displayed t
  17. org-tags-column 80)
  18. ; Refile targets include this file and any file contributing to the agenda - up to 5 levels deep
  19. (setq org-refile-targets (quote ((nil :maxlevel . 5) (org-agenda-files :maxlevel . 5))))
  20. ; Targets start with the file name - allows creating level 1 tasks
  21. (setq org-refile-use-outline-path (quote file))
  22. ; Targets complete in steps so we start with filename, TAB shows the next level of targets etc
  23. (setq org-outline-path-complete-in-steps t)
  24. (setq org-todo-keywords
  25. (quote ((sequence "TODO(t)" "STARTED(s)" "|" "DONE(d!/!)")
  26. (sequence "WAITING(w@/!)" "SOMEDAY(S)" "|" "CANCELLED(c@/!)"))))
  27. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  28. ;; Org clock
  29. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  30. ;; Save the running clock and all clock history when exiting Emacs, load it on startup
  31. (setq org-clock-persistence-insinuate t)
  32. (setq org-clock-persist t)
  33. (setq org-clock-in-resume t)
  34. ;; Change task state to STARTED when clocking in
  35. (setq org-clock-in-switch-to-state "STARTED")
  36. ;; Save clock data and notes in the LOGBOOK drawer
  37. (setq org-clock-into-drawer t)
  38. ;; Removes clocked tasks with 0:00 duration
  39. (setq org-clock-out-remove-zero-time-clocks t)
  40. ;; Show clock sums as hours and minutes, not "n days" etc.
  41. (setq org-time-clocksum-format
  42. '(:hours "%d" :require-hours t :minutes ":%02d" :require-minutes t))
  43. ;; Show the clocked-in task - if any - in the header line
  44. (defun sanityinc/show-org-clock-in-header-line ()
  45. (setq-default header-line-format '((" " org-mode-line-string " "))))
  46. (defun sanityinc/hide-org-clock-from-header-line ()
  47. (setq-default header-line-format nil))
  48. (add-hook 'org-clock-in-hook 'sanityinc/show-org-clock-in-header-line)
  49. (add-hook 'org-clock-out-hook 'sanityinc/hide-org-clock-from-header-line)
  50. (add-hook 'org-clock-cancel-hook 'sanityinc/hide-org-clock-from-header-line)
  51. (after-load 'org-clock
  52. (define-key org-clock-mode-line-map [header-line mouse-2] 'org-clock-goto)
  53. (define-key org-clock-mode-line-map [header-line mouse-1] 'org-clock-menu))
  54. (require-package 'org-pomodoro)
  55. (after-load 'org-agenda
  56. (define-key org-agenda-mode-map (kbd "P") 'org-pomodoro))
  57. ;; ;; Show iCal calendars in the org agenda
  58. ;; (when (and *is-a-mac* (require 'org-mac-iCal nil t))
  59. ;; (setq org-agenda-include-diary t
  60. ;; org-agenda-custom-commands
  61. ;; '(("I" "Import diary from iCal" agenda ""
  62. ;; ((org-agenda-mode-hook #'org-mac-iCal)))))
  63. ;; (add-hook 'org-agenda-cleanup-fancy-diary-hook
  64. ;; (lambda ()
  65. ;; (goto-char (point-min))
  66. ;; (save-excursion
  67. ;; (while (re-search-forward "^[a-z]" nil t)
  68. ;; (goto-char (match-beginning 0))
  69. ;; (insert "0:00-24:00 ")))
  70. ;; (while (re-search-forward "^ [a-z]" nil t)
  71. ;; (goto-char (match-beginning 0))
  72. ;; (save-excursion
  73. ;; (re-search-backward "^[0-9]+:[0-9]+-[0-9]+:[0-9]+ " nil t))
  74. ;; (insert (match-string 0))))))
  75. (after-load 'org
  76. (define-key org-mode-map (kbd "C-M-<up>") 'org-up-element)
  77. ; (when *is-a-mac*
  78. ; (define-key org-mode-map (kbd "M-h") nil))
  79. (define-key org-mode-map (kbd "C-M-<up>") 'org-up-element)
  80. ; (when *is-a-mac*
  81. ; (define-key org-mode-map (kbd "C-c g") 'org-mac-grab-link)))
  82. )
  83. (after-load 'org
  84. (org-babel-do-load-languages
  85. 'org-babel-load-languages
  86. '((R . t)
  87. (ditaa . t)
  88. (dot . t)
  89. (emacs-lisp . t)
  90. (gnuplot . t)
  91. (haskell . nil)
  92. (latex . t)
  93. (ledger . t)
  94. (ocaml . nil)
  95. (octave . t)
  96. (python . t)
  97. (ruby . t)
  98. (screen . nil)
  99. (sh . t)
  100. (sql . nil)
  101. (sqlite . t))))
  102. (provide 'init-org)