Emacs personal configuration
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

117 rindas
4.1KB

  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. ; Refile targets include this file and any file contributing to the agenda - up to 5 levels deep
  27. (setq org-refile-targets (quote ((nil :maxlevel . 5) (org-agenda-files :maxlevel . 5))))
  28. ; Targets start with the file name - allows creating level 1 tasks
  29. (setq org-refile-use-outline-path (quote file))
  30. ; Targets complete in steps so we start with filename, TAB shows the next level of targets etc
  31. (setq org-outline-path-complete-in-steps t)
  32. (setq org-todo-keywords
  33. (quote ((sequence "TODO(t)" "NEXT(n)" "STARTED(s)" "|" "DONE(d!/!)")
  34. (sequence "WAITING(w@/!)" "SOMEDAY(S)" "|" "CANCELLED(c@/!)" "MEETING"))))
  35. (setq org-todo-keyword-faces
  36. (quote (("TODO" :foreground "red" :weight bold)
  37. ("NEXT" :foreground "blue" :weight bold)
  38. ("STARTED" :foreground "yellow" :weight bold)
  39. ("DONE" :foreground "forest green" :weight bold)
  40. ("WAITING" :foreground "orange" :weight bold)
  41. ("SOMEDAY" :foreground "magenta" :weight bold)
  42. ("CANCELLED" :foreground "forest green" :weight bold)
  43. ("MEETING" :foreground "forest green" :weight bold))))
  44. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  45. ;; Org clock
  46. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  47. ;; Save the running clock and all clock history when exiting Emacs, load it on startup
  48. (setq org-clock-persistence-insinuate t)
  49. (setq org-clock-persist t)
  50. (setq org-clock-in-resume t)
  51. ;; Change task state to STARTED when clocking in
  52. (setq org-clock-in-switch-to-state "STARTED")
  53. ;; Save clock data and notes in the LOGBOOK drawer
  54. (setq org-clock-into-drawer t)
  55. ;; Removes clocked tasks with 0:00 duration
  56. (setq org-clock-out-remove-zero-time-clocks t)
  57. ;; Show clock sums as hours and minutes, not "n days" etc.
  58. (setq org-time-clocksum-format
  59. '(:hours "%d" :require-hours t :minutes ":%02d" :require-minutes t))
  60. ;; Show the clocked-in task - if any - in the header line
  61. (defun sanityinc/show-org-clock-in-header-line ()
  62. (setq-default header-line-format '((" " org-mode-line-string " "))))
  63. (defun sanityinc/hide-org-clock-from-header-line ()
  64. (setq-default header-line-format nil))
  65. (add-hook 'org-clock-in-hook 'sanityinc/show-org-clock-in-header-line)
  66. (add-hook 'org-clock-out-hook 'sanityinc/hide-org-clock-from-header-line)
  67. (add-hook 'org-clock-cancel-hook 'sanityinc/hide-org-clock-from-header-line)
  68. (after-load 'org-clock
  69. (define-key org-clock-mode-line-map [header-line mouse-2] 'org-clock-goto)
  70. (define-key org-clock-mode-line-map [header-line mouse-1] 'org-clock-menu))
  71. (require-package 'org-pomodoro)
  72. (after-load 'org-agenda
  73. (define-key org-agenda-mode-map (kbd "P") 'org-pomodoro))
  74. (after-load 'org
  75. (define-key org-mode-map (kbd "C-M-<up>") 'org-up-element))
  76. (after-load 'org
  77. (org-babel-do-load-languages
  78. 'org-babel-load-languages
  79. '((R . t)
  80. (ditaa . t)
  81. (dot . t)
  82. (emacs-lisp . t)
  83. (gnuplot . t)
  84. (haskell . t)
  85. (latex . t)
  86. (ledger . t)
  87. (ocaml . nil)
  88. (octave . t)
  89. (python . t)
  90. (ruby . t)
  91. (screen . nil)
  92. (shell . t)
  93. (sql . t)
  94. (sqlite . t))))
  95. (provide 'init-org)
  96. ;;; init-org.el ends here