blob: 8bc324c4e61152ccfe6e3c52a79854ce25ae1103 (
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
|
;;; Org
(use-package org
:ensure nil ; do not try to install it as it is built-in
:commands (org-capture org-agenda)
:custom
(org-M-RET-may-split-line '((default . nil)))
(org-insert-heading-respect-content t)
(org-log-done 'time)
(org-log-into-drawer t)
(org-capture-bookmark nil)
(org-directory "~/org/")
(org-default-notes-file (concat org-directory "agenda.org"))
(org-agenda-files (list org-directory))
;; Learn about the ! and more by reading the relevant section of the
;; Org manual. Evaluate: (info "(org) Tracking TODO state changes")
(org-todo-keywords '((sequence "TODO(t)"
"STARTED(s!)"
"NEXT(n)"
"SOMEDAY(.)"
"WAITING(w@)""|" "DONE(x!)" "CANCELLED(c@)")))
(org-startup-indented t)
(org-pretty-entities t)
(org-startup-with-inline-images t)
(org-image-actual-width 300)
:config
(define-key org-mode-map (kbd "C-c C-r") verb-command-map)
(setq org-anki-file (concat org-directory "anki.org"))
(setq org-capture-templates
`(("f" "Fleeting note" item
(file+headline org-default-notes-file "Notes")
"- %?")
("o" "Quote" item
(file+headline ,(concat org-directory "quotes.org") "Quotes")
"- %?")
("p" "Permanent note" plain
(file denote-last-path)
#'denote-org-capture
:no-save t
:immediate-finish nil
:kill-buffer t
:jump-to-captured nil)
("t" "New task" entry
(file+headline org-default-notes-file "Tasks")
"* TODO %i%?")
("j" "Journal" entry
(file denote-journal-path-to-new-or-existing-entry)
"* %U %?\n%i\n%a"
:kill-buffer t
:empty-lines 1)
("a" "Anki basic"
entry
(file+headline org-anki-file "Dispatch Shelf")
"* Card%^g\n:PROPERTIES:\n:ANKI_NOTE_TYPE: Basic\n:ANKI_DECK: Mega\n:END:\n** Front\n%?\n** Back\n%c\n")
("A" "Anki cloze"
entry
(file+headline org-anki-file "Dispatch Shelf")
"* Card%^g\n:PROPERTIES:\n:ANKI_NOTE_TYPE: Cloze\n:ANKI_DECK: Mega\n:END:\n** Text\n%c\n** Extra\n")))
(add-to-list 'org-export-backends 'md)
:bind
(("C-c C" . org-capture)
("C-c A" . org-agenda)))
(use-package org-modern
:ensure t
:defer t
:hook (org-mode . org-modern-mode)
:custom
(org-modern-star "replace"))
(use-package denote
:after org
:init
(denote-rename-buffer-mode 1)
:custom
(denote-directory (concat org-directory "/notes/"))
:hook
(dired-mode . denote-dired-mode)
:config
;; https://github.com/protesilaos/denote/issues/681
(add-to-list 'denote-file-types
'(org-gpg
:extension ".org.gpg"
:front-matter denote-org-front-matter
:title-key-regexp "^#\\+title\\s-*:"
:title-value-function denote-format-string-for-org-front-matter
:title-value-reverse-function denote-trim-whitespace
:keywords-key-regexp "^#\\+filetags\\s-*:"
:keywords-value-function denote-format-keywords-for-org-front-matter
:keywords-value-reverse-function denote-extract-keywords-from-front-matter
:signature-key-regexp "^#\\+signature\\s-*:"
:signature-value-function denote-format-string-for-org-front-matter
:signature-value-reverse-function denote-trim-whitespace
:identifier-key-regexp "^#\\+identifier\\s-*:"
:identifier-value-function denote-format-string-for-org-front-matter
:identifier-value-reverse-function denote-trim-whitespace
:date-key-regexp "^#\\+date\\s-*:"
:date-value-function denote-date-org-timestamp
:date-value-reverse-function denote-extract-date-from-front-matter
:link-retrieval-format "[denote:%VALUE%]"
:link denote-org-link-format
:link-in-context-regexp denote-org-link-in-context-regexp))
:custom-face
(denote-faces-link ((t (:slant italic))))
:bind (("C-c n l" . denote-link-or-create)
("C-c n f" . consult-denote-find)
("C-c n c" . denote)
("C-c n e" . (lambda () (interactive) (dired org-directory)))))
(use-package consult-denote)
(use-package denote-journal
:ensure t
:hook (calendar-mode . denote-journal-calendar-mode)
:config
(defun my-denote-journal-new-entry ()
"Like `denote-journal-new-entry' but specifies a file type of my preference."
(interactive)
(let ((denote-file-type 'org-gpg)) ; assumes `org-gpg' exists
(call-interactively 'denote-journal-new-entry)))
;; Use the "journal" subdirectory of the `denote-directory'. Set this
;; to nil to use the `denote-directory' instead.
(setq denote-journal-directory
(expand-file-name "journal" denote-directory))
;; Default keyword for new journal entries. It can also be a list of
;; strings.
(setq denote-journal-keyword "journal")
;; Read the doc string of `denote-journal-title-format'.
(setq denote-journal-title-format 'day-date-month-year)
:bind
(("C-c n j" . my-denote-journal-new-entry)))
;;; Org Present
(use-package org-present
:config
(eval-after-load "org-present"
'(progn
(add-hook 'org-present-mode-hook
(lambda ()
;; (meow-motion-mode)
(org-present-big)
(org-display-inline-images)
(org-present-hide-cursor)
(org-present-read-only)))
(add-hook 'org-present-mode-quit-hook
(lambda ()
;; (meow-normal-mode)
(org-present-small)
(org-remove-inline-images)
(org-present-show-cursor)
(org-present-read-write))))))
;;; Anki editor
(use-package anki-editor
:bind
(:map org-mode-map ("C-c a" . anki-editor-ui)))
;;; HTTP Client
(use-package verb)
(require 'org-demo-macro)
(provide 'org-mode-config)
|