blob: 67a106c9212a0e246583deb3154a7de2ff22b371 (
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
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
|
;; |------------------------------------|
;; | Org Config |
;; |------------------------------------|
(require 'bard-emacs-ui)
(require 'org)
(require 'ox)
;; Org Variables
(setq org-directory "~/Notes/denote/")
;; symlinked file to shorten denote file name in agenda buffers
(setq org-agenda-files (list "~/Notes/denote/todo.org"))
(setq org-archive-location "~/Notes/denote/20240328T215840--archive__self.org::* Archive")
(setq org-log-done 'time)
;; Making org mode look nice
(setq org-startup-indented t
org-hide-emphasis-markers t
org-startup-with-inline-images t
org-image-actual-width '(600)
org-list-allow-alphabetical t
org-insert-heading-respect-content t
org-special-ctrl-a/e t)
(with-eval-after-load "org-mode"
(setq org-format-latex-options (plist-put org-format-latex-options :scale 1.6))
)
;; Org Babel
(org-babel-do-load-languages
'org-babel-load-languages
'(;; other Babel languages
(plantuml . t)))
(setq org-plantuml-jar-path "/home/bard/opt/plantuml/plantuml-1.2024.3.jar")
;; latex editing niceness
(use-package org-fragtog
:ensure t)
;; Calendar
(with-eval-after-load 'calendar-mode
(setq calendar-holidays (append calendar-holidays russian-holidays))
(add-hook 'calendar-today-visible-hook 'calendar-mark-today)
(add-hook 'calendar-today-visible-hook 'calendar-mark-holidays))
(define-key global-map (kbd "C-z C-c") #'calendar)
;; Org todo keywords - changed to using hl-todo faces fixed by modus/ef themes
(setq org-todo-keywords
'((sequence "TODO(t)" "|" "DONE(d)" "KILLED(k)")
(sequence "MEET(m)" "|" "MET(M)")))
;; Org Mode Key map
(defun bard/org-mode-keybindings ()
(define-key org-mode-map (kbd "C-c a") 'org-table-align))
(add-hook 'org-mode-hook 'bard/org-mode-keybindings)
;; (add-hook 'org-mode-hook 'fly-spell-mode)
;; Org Agenda Faces
(custom-set-faces '(org-agenda-structure ((t (:inherit bold :height 1.5 :family "Iosevka Comfy Motion")))))
(setq org-ellipsis "↲")
;; Org Agenda
(defun bard/choose-agenda ()
"For viewing my custom agenda"
(interactive)
(let ((agenda-views '("Default" "Monthly" "Yearly")))
(setq chosen-view (completing-read "Choose an agenda view: " agenda-views))
(cond
((string= chosen-view "Yearly")
(org-agenda nil "Y"))
((string= chosen-view "Monthly")
(org-agenda nil "M"))
((string= chosen-view "Default")
(org-agenda nil "D")))))
(global-set-key (kbd "M-<f1>") 'bard/choose-agenda)
(global-set-key (kbd "C-z C-a") 'bard/choose-agenda)
(defun bard/default-agenda ()
"For viewing my custom agenda"
(interactive)
(org-agenda nil "D"))
(global-set-key (kbd "<f1>") 'bard/default-agenda)
(global-set-key (kbd "C-z a") 'bard/default-agenda)
;; Org Agenda
(setq org-agenda-custom-commands
`(("D" "Daily agenda and top priority tasks"
((tags-todo "!TODO"
((org-agenda-overriding-header "Unscheduled Tasks \n")
(org-agenda-skip-function '(org-agenda-skip-entry-if 'timestamp))))
(agenda "" ((org-agenda-span 1)
(org-agenda-start-day nil)
(org-deadline-warning-days 0)
(org-scheduled-past-days 0)
(org-agenda-day-face-function (lambda (date) 'org-agenda-date))
(org-agenda-format-date "%A %-e %B %Y")
(org-agenda-overriding-header "Today's agenda \n")))
(agenda "" ((org-agenda-span 7)
(org-deadline-warning-days 0)
(org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
(org-agenda-overriding-header "Upcoming this week \n")))
(tags "+wait"
((org-agenda-overriding-header "Low Priority Tasks\n")
(org-agenda-skip-function '(org-agenda-skip-entry-if 'timestamp))))))
("Y" "Yearly view for all tasks"
((agenda "" ((org-agenda-span 365)
(org-deadline-warning-days 2)
(org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
(org-agenda-overriding-header "Upcoming this Year\n")))))
("M" "Monthly view for all tasks"
((agenda "" ((org-agenda-span 31)
(org-deadline-warning-days 2)
(org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
(org-agenda-overriding-header "Upcoming this month\n")))))))
(use-package org-timeblock
:ensure t
:config
(define-key global-map (kbd "C-z c") 'org-timeblock))
(use-package orthodox-christian-new-calendar-holidays
:ensure t
:config
(setq holiday-other-holidays (append holiday-other-holidays orthodox-christian-new-calendar-holidays))
(setq holiday-bahai-holidays nil
holiday-christian-holidays nil
holiday-islamic-holidays nil))
;; Org capture templates
(define-key global-map (kbd "C-c c") #'org-capture)
(require 'org-protocol)
(setq org-capture-templates
'(("i" "Important Stuff" entry (file+olp "~/Notes/denote/20240328T215727--todo__self.org" "Inbox" "Important Stuff")
"* TODO %?")
("e" "Extra/Coding" entry (file+olp "~/Notes/denote/20240328T215727--todo__self.org" "Inbox" "Extra/Coding")
"* TODO %?")
("j" "Journal" entry (file+datetree "~/Notes/denote/20240328T215351--journal__journal_self.org")
"* %U %^{Title}\n %?")
("a" "Appointments" entry (file+olp "~/Notes/denote/20240328T215727--todo__self.org" "Appointments" "General")
"* MEET %^{Appointment}\nSCHEDULED: %^t\n%?")
("p" "Protocol" entry (file+olp "~/Notes/denote/20240328T220037--media-tracker__self.org" "Quotes")
"* Source: [[%:link][%:description]]\n#+BEGIN_QUOTE\n%i\n#+END_QUOTE\n%?")
("L" "Protocol Link" entry (file+olp "~/Notes/denote/20240328T220037--media-tracker__self.org" "Watch/Read List")
"* [[%:link][%:description]] \nCaptured On: %U \n%?")
("b" "Blog Article" entry (file+olp "~/Code/bardmandev/content/_index.org" "Latest updates"))))
(use-package denote
:config
(setq denote-directory "~/Notes/denote/")
(setq denote-journal-extras-directory "~/Notes/journal")
(setq denote-known-keywords
'("emacs"
"linux"
"programming"
"org"
"school"
"language"
"history"
"biology"
))
(denote-rename-buffer-mode 1)
(add-hook 'dired-mode-hook #'denote-dired-mode)
;; journalling with timer
(add-hook 'denote-journal-extras-hook (lambda ()
(tmr "10" "Journaling")))
:bind
(("C-c n n" . denote-open-or-create)
("C-c n N" . denote)
("C-c n d" . denote-date)
("C-c n o" . denote-sort-dired)
("C-c n j" . denote-journal-extras-new-entry)
("C-c n r" . denote-rename-file)
("C-c n i" . denote-link)
("C-c n I" . denote-add-links)
("C-c n b" . denote-backlinks)
("C-c n f" . denote-find-link)
("C-c n F" . denote-find-backlink)))
(provide 'bard-emacs-org.el)
|