summaryrefslogtreecommitdiff
path: root/.config/emacs/modules/bd--org.el
blob: c4ade638e2b92c3eb19e1f95987a4d1068c6335c (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
;; -*- lexical-binding: t; -*-


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

(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-toggle-pretty-entities))

;; hooks
(add-hook 'org-mode-hook 'bd/org-mode-setup-hook)

;; binds
(keymap-global-set "C-c n a" 'org-agenda)
(keymap-global-set "C-c n c" 'org-capture)
(keymap-global-set "C-c n s" 'org-schedule)
(keymap-global-set "C-c n d" 'org-deadline)
(keymap-global-set "C-c n r" 'org-refile)

;; source blocks
(org-babel-do-load-languages
 'org-babel-load-languages
 '((emacs-lisp . t)
   (python . t)
   (shell . t)
   (lisp . t)))

;; standard
(setopt org-startup-folded 'show2levels
        org-ellipsis " ▾")

;; agenda
(advice-add 'org-refile :after 'org-save-all-org-buffers) ; after refiling tasks, save all buffers

(setopt org-agenda-files
        `(,agenda-file "~/Personal/roam/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!)" "|" "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
        `(("t" " Tasks")
          ("ts" "Software Testing" entry (file+olp ,agenda-file "CS415")
           "* TODO %?\n DEADLINE: %^t")
          ("tm" "Machine Learning" entry (file+olp ,agenda-file "CS445")
           "* TODO %?\n DEADLINE: %^t")
          ("tp" "Programming Languages" entry (file+olp ,agenda-file "CS454")
           "* TODO %?\n DEADLINE: %^t")
          ("tc" "Creative Writing" entry (file+olp ,agenda-file "E210")
           "* TODO %?\n DEADLINE: %^t")
          ("s" " Self")
          ("s" "Unsorted Task" entry (file+olp ,agenda-file "Self")
           "* TODO %?\n %^t\n %a"))

        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-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-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)