-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathorg-mode-config.el
312 lines (262 loc) · 11.7 KB
/
org-mode-config.el
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
;; Enable use-package
(eval-when-compile
(require 'use-package))
(setq use-package-always-ensure t)
(use-package org
:pin gnu)
;; Must do this so the agenda knows where to look for my files
(setq org-agenda-files '("~/org"))
;; When a TODO is set to a done state, record a timestamp
(setq org-log-done 'time)
;; Follow the links
(setq org-return-follows-link t)
;; Associate all org files with org mode
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
;; Make the indentation look nicer
(add-hook 'org-mode-hook 'org-indent-mode)
;; Remap the change priority keys to use the UP or DOWN key
(define-key org-mode-map (kbd "C-c <up>") 'org-priority-up)
(define-key org-mode-map (kbd "C-c <down>") 'org-priority-down)
;; Shortcuts for storing links, viewing the agenda, and starting a capture
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(define-key global-map "\C-cc" 'org-capture)
;; When you want to change the level of an org item, use SMR
(define-key org-mode-map (kbd "C-c C-g C-r") 'org-shiftmetaright)
;; Hide the markers so you just see bold text as BOLD-TEXT and not *BOLD-TEXT*
(setq org-hide-emphasis-markers t)
;; Wrap the lines in org mode so that things are easier to read
(add-hook 'org-mode-hook 'visual-line-mode)
(let* ((variable-tuple
(cond ((x-list-fonts "ETBembo") '(:font "ETBembo"))
((x-list-fonts "Source Sans Pro") '(:font "Source Sans Pro"))
((x-list-fonts "Lucida Grande") '(:font "Lucida Grande"))
((x-list-fonts "Verdana") '(:font "Verdana"))
((x-family-fonts "Sans Serif") '(:family "Sans Serif"))
(nil (warn "Cannot find a Sans Serif Font. Install Source Sans Pro."))))
(base-font-color (face-foreground 'default nil 'default))
(headline `(:inherit default :weight bold :foreground ,base-font-color)))
(custom-theme-set-faces
'user
`(org-level-8 ((t (,@headline ,@variable-tuple))))
`(org-level-7 ((t (,@headline ,@variable-tuple))))
`(org-level-6 ((t (,@headline ,@variable-tuple))))
`(org-level-5 ((t (,@headline ,@variable-tuple))))
`(org-level-4 ((t (,@headline ,@variable-tuple :height 1.1))))
`(org-level-3 ((t (,@headline ,@variable-tuple :height 1.2))))
`(org-level-2 ((t (,@headline ,@variable-tuple :height 1.3))))
`(org-level-1 ((t (,@headline ,@variable-tuple :height 1.5))))
`(org-document-title ((t (,@headline ,@variable-tuple :height 1.6 :underline nil))))))
(setq org-capture-templates
'(
("j" "Work Log Entry"
entry (file+datetree "~/org/work-log.org")
"* %?"
:empty-lines 0)
("n" "Note"
entry (file+headline "~/org/notes.org" "Random Notes")
"** %?"
:empty-lines 0)
("n" "Note"
entry (file+headline "~/org/notes.org" "Random Notes")
"** %?"
:empty-lines 0)
("d" "Door Codes"
entry (file+headline "~/org/notes.org" "Door Codes")
"** %?"
:empty-lines 0)
("g" "General To-Do"
entry (file+headline "~/org/todos.org" "General Tasks")
"* TODO [#B] %?\n:Created: %T\n "
:empty-lines 0)
("m" "Meeting"
entry (file+datetree "~/org/meetings.org")
"* %? :meeting:%^g \n:Created: %T\n** Attendees\n*** \n** Notes\n** Action Items\n*** TODO [#A] "
:tree-type week
:clock-in t
:clock-resume t
:empty-lines 0)
("c" "Code To-Do"
entry (file+headline "~/org/todos.org" "Code Related Tasks")
"* TODO [#B] %?\n:Created: %T\n%i\n%a\nProposed Solution: "
:empty-lines 0)
))
(setq org-todo-keywords
'((sequence "TODO(t)" "PLANNING(p)" "IN-PROGRESS(i@/!)" "VERIFYING(v!)" "BLOCKED(b@)" "|" "DONE(d!)" "OBE(o@!)" "WONT-DO(w@/!)" )
))
(setq org-todo-keyword-faces
'(
("TODO" . (:foreground "GoldenRod" :weight bold))
("PLANNING" . (:foreground "DeepPink" :weight bold))
("IN-PROGRESS" . (:foreground "Cyan" :weight bold))
("VERIFYING" . (:foreground "DarkOrange" :weight bold))
("BLOCKED" . (:foreground "Red" :weight bold))
("DONE" . (:foreground "LimeGreen" :weight bold))
("OBE" . (:foreground "LimeGreen" :weight bold))
("WONT-DO" . (:foreground "LimeGreen" :weight bold))
))
;; Tags
(setq org-tag-alist '(
;; Ticket types
(:startgroup . nil)
("@bug" . ?b)
("@feature" . ?u)
("@spike" . ?j)
(:endgroup . nil)
;; Ticket flags
("@write_future_ticket" . ?w)
("@emergency" . ?e)
("@research" . ?r)
;; Meeting types
(:startgroup . nil)
("big_sprint_review" . ?i)
("cents_sprint_retro" . ?n)
("dsu" . ?d)
("grooming" . ?g)
("sprint_retro" . ?s)
(:endgroup . nil)
;; Code TODOs tags
("QA" . ?q)
("backend" . ?k)
("broken_code" . ?c)
("frontend" . ?f)
;; Special tags
("CRITICAL" . ?x)
("obstacle" . ?o)
;; Meeting tags
("HR" . ?h)
("general" . ?l)
("meeting" . ?m)
("misc" . ?z)
("planning" . ?p)
;; Work Log Tags
("accomplishment" . ?a)
))
;; Tag colors
(setq org-tag-faces
'(
("planning" . (:foreground "mediumPurple1" :weight bold))
("backend" . (:foreground "royalblue1" :weight bold))
("frontend" . (:foreground "forest green" :weight bold))
("QA" . (:foreground "sienna" :weight bold))
("meeting" . (:foreground "yellow1" :weight bold))
("CRITICAL" . (:foreground "red1" :weight bold))
)
)
;; Agenda View "d"
(defun air-org-skip-subtree-if-priority (priority)
"Skip an agenda subtree if it has a priority of PRIORITY.
PRIORITY may be one of the characters ?A, ?B, or ?C."
(let ((subtree-end (save-excursion (org-end-of-subtree t)))
(pri-value (* 1000 (- org-lowest-priority priority)))
(pri-current (org-get-priority (thing-at-point 'line t))))
(if (= pri-value pri-current)
subtree-end
nil)))
(setq org-agenda-skip-deadline-if-done t)
(setq org-agenda-custom-commands
'(
;; Daily Agenda & TODOs
("d" "Daily agenda and all TODOs"
;; Display items with priority A
((tags "PRIORITY=\"A\""
((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
(org-agenda-overriding-header "High-priority unfinished tasks:")))
;; View 7 days in the calendar view
(agenda "" ((org-agenda-span 7)))
;; Display items with priority B (really it is view all items minus A & C)
(alltodo ""
((org-agenda-skip-function '(or (air-org-skip-subtree-if-priority ?A)
(air-org-skip-subtree-if-priority ?C)
(org-agenda-skip-if nil '(scheduled deadline))))
(org-agenda-overriding-header "ALL normal priority tasks:")))
;; Display items with pirority C
(tags "PRIORITY=\"C\""
((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
(org-agenda-overriding-header "Low-priority Unfinished tasks:")))
)
;; Don't compress things (change to suite your tastes)
((org-agenda-compact-blocks nil)))
;; James's Super View
("j" "James's Super View"
(
(agenda ""
(
(org-agenda-remove-tags t)
(org-agenda-span 7)
)
)
(alltodo ""
(
;; Remove tags to make the view cleaner
(org-agenda-remove-tags t)
(org-agenda-prefix-format " %t %s")
(org-agenda-overriding-header "CURRENT STATUS")
;; Define the super agenda groups (sorts by order)
(org-super-agenda-groups
'(
;; Filter where tag is CRITICAL
(:name "Critical Tasks"
:tag "CRITICAL"
:order 0
)
;; Filter where TODO state is IN-PROGRESS
(:name "Currently Working"
:todo "IN-PROGRESS"
:order 1
)
;; Filter where TODO state is PLANNING
(:name "Planning Next Steps"
:todo "PLANNING"
:order 2
)
;; Filter where TODO state is BLOCKED or where the tag is obstacle
(:name "Problems & Blockers"
:todo "BLOCKED"
:tag "obstacle"
:order 3
)
;; Filter where tag is @write_future_ticket
(:name "Tickets to Create"
:tag "@write_future_ticket"
:order 4
)
;; Filter where tag is @research
(:name "Research Required"
:tag "@research"
:order 7
)
;; Filter where tag is meeting and priority is A (only want TODOs from meetings)
(:name "Meeting Action Items"
:and (:tag "meeting" :priority "A")
:order 8
)
;; Filter where state is TODO and the priority is A and the tag is not meeting
(:name "Other Important Items"
:and (:todo "TODO" :priority "A" :not (:tag "meeting"))
:order 9
)
;; Filter where state is TODO and priority is B
(:name "General Backlog"
:and (:todo "TODO" :priority "B")
:order 10
)
;; Filter where the priority is C or less (supports future lower priorities)
(:name "Non Critical"
:priority<= "C"
:order 11
)
;; Filter where TODO state is VERIFYING
(:name "Currently Being Verified"
:todo "VERIFYING"
:order 20
)
)
)
)
)
))
))