summaryrefslogtreecommitdiff
path: root/.config/emacs/modules/bd--org.el
blob: b59327de659f627037c1e31733102ac574c7a170 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
;;; -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:


(defvar-local agenda-file "~/dc/agenda/agenda_tasks.org")

(use-package org
  :bind
  (("C-c n a" . org-agenda)
   ("C-c n c" . org-capture)
   ("C-c n s" . org-schedule)
   ("C-c n d" . org-deadline)
   ("C-c n r" . org-refile))
  :config
  (defun bd/org-mode-setup-hook ()
    "Sets up improved org-mode defaults upon
each org file open."
    (org-indent-mode)
    (org-toggle-inline-images)
    (org-latex-preview '(16)))
  (add-hook 'org-mode-hook 'bd/org-mode-setup-hook)
  
  (org-babel-do-load-languages
   'org-babel-load-languages
   '((emacs-lisp . t)
     (shell . t)
     (lisp . t)
     (scheme . t)
     (dot . t)))

  (advice-add 'org-refile :after 'org-save-all-org-buffers)
  :custom
  (org-startup-folded 'show2levels)
  (org-ellipsis " ▾")
  (org-export-with-toc nil)
  (org-export-preserve-breaks t)
  (org-agenda-files `(,agenda-file "~/dc/agenda/archived_tasks.org"))
  (org-deadline-warning-days 7)
  (org-log-done 'time)
  (org-log-into-drawer "history")
  
  (org-todo-keywords
   '((sequence "TODO(t)" "NEXT(n!)" "HOLD(h!)" "|" "DONE(d)" "CANC(c)")))

  (org-refile-targets ; refile into the headings of these files, not tags
   '(("archived_tasks.org" :maxlevel . 1)
     ("agenda_tasks.org" :maxlevel . 1)))
  
  (org-capture-templates
   `(("c" " College")
     ("cs" "Software Engineering Theory" entry (file+olp ,agenda-file "CS520")
      "* TODO %?\n DEADLINE: %^t")
     ("cm" "Combinatorics/Graph Theory" entry (file+olp ,agenda-file "CS575")
      "* TODO %?\n DEADLINE: %^t")
     ("cc" "Compiler Techniques" entry (file+olp ,agenda-file "CS610")
      "* TODO %?\n DEADLINE: %^t")
     ("s" " Self")
     ("si" "Idea" entry (file+olp ,agenda-file "Idea / Return")
      "* TODO %?\n %u")
     ("sc" "Context" entry (file+olp ,agenda-file "Idea / Return")
      "* TODO %?\n %a")
     ("st" "Deadline" entry (file+olp ,agenda-file "Deadline")
      "* TODO %?\n DEADLINE: %^t")
     ("sb" "Book" entry (file+olp ,agenda-file "Book List")
      "* TODO %?\n %u")))

  (org-agenda-restore-windows-after-quit t)
  (org-agenda-custom-commands
  '(("S" "Standard Block Agenda"
     ((tags-todo "*"
                 ((org-agenda-skip-function '(org-agenda-skip-if nil '(timestamp)))
                  (org-agenda-block-separator nil)
                  (org-agenda-skip-function '(org-agenda-skip-entry-if 'todo  '("HOLD")))
                  (org-agenda-overriding-header "Undated Tasks\n")))
      (agenda "" ((org-agenda-span 8)
                  (org-deadline-warning-days 0)
                  (org-agenda-block-separator nil)
                  (org-scheduled-past-days 4)
                  (org-agenda-skip-function '(org-agenda-skip-entry-if 'todo '("HOLD")))
                  (org-agenda-overriding-header "\nUpcoming Tasks\n")))
      (agenda "" ((org-agenda-time-grid nil)
                  (org-agenda-show-all-dates nil)
                  (org-agenda-span 21)
                  (org-deadline-warning-days 0)
                  (org-agenda-block-separator nil)
                  (org-agenda-entry-types '(:deadline))
                  (org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
                  (org-agenda-overriding-header "\nFuture Deadlines (+21d)\n"))))))))


(provide 'bd--org)
;;; bd-org ends here