From 5c212729cf605a474ef32e4ceea041c0ccc80d48 Mon Sep 17 00:00:00 2001 From: noa Date: Sun, 16 Feb 2025 22:02:59 +0800 Subject: Update org config --- emacs/init.el | 100 ++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 63 insertions(+), 37 deletions(-) diff --git a/emacs/init.el b/emacs/init.el index 4f2cddf..71e8359 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -769,6 +769,7 @@ With prefix argument TIME, also add the current time." (kill-new (file-name-nondirectory (buffer-file-name))))) (use-package org + :defer t :init ;; Repurpose underline syntax for cloze deletion face (defface my-cloze '((t . (:box t))) "Cloze face for Inline-Anki") @@ -780,74 +781,99 @@ With prefix argument TIME, also add the current time." ("+" (:strike-through t)))) :custom - (org-agenda-files '("~/Documents/Notes.org")) + (org-agenda-files '("~/Documents/Notes.org" "~/Documents/Notes/")) (org-replace-disputed-keys t) (org-support-shift-select 'always) ;; Still refuses to fix on timestamps :/ (org-log-done 'time) (org-pretty-entities t) - (org-hide-emphasis-markers t) - (org-startup-with-inline-images t)) + (org-startup-with-inline-images t) + (org-image-actual-width '(300)) + (org-ellipsis " [+]") + (org-insert-heading-respect-content t) + (org-fontify-done-headline nil) + (org-fontify-todo-headline nil) + (org-fontify-whole-heading-line t) + (org-src-fontify-natively t) + (org-src-tab-acts-natively t) + (org-edit-src-content-indentation 0) + (org-use-sub-superscripts '{}) + + :hook ((org-mode . font-lock-mode)) -(use-package org-node - :ensure t + ) + +(add-hook 'text-mode-hook (lambda () + (setq-local line-spacing 0.1))) + +(use-package oc :after org + :custom + (org-cite-global-bibliography '("~/Documents/Library/References.bib")) + (org-cite-export-processors '((beamer csl) + (latex csl) + (t csl)))) +(use-package oc-csl + :after oc + :custom + (org-cite-csl-styles-dir "~/Documents/Library/CSL/Styles") + (org-cite-csl-locales-dir "~/Documents/Library/CSL/Locales")) + +;; Not working how i want +(use-package org-capture + :bind ("C-c c" . org-capture) :custom - (org-node-prefer-with-heading t) - (org-node-creation-fn #'noa/org-node-new-node) + (org-capture-templates + '(("d" "Today's diary" entry + (file+headline "~/Documents/Notes.org" "Diary") + "** %u\n%?")))) - :config - (org-node-cache-mode) - (org-node-backlink-mode) - (defvar noa/org-notes-file "~/Documents/Notes.org") - (defun noa/org-node-new-node () - "Create a node in my notes file. -Meant to be called indirectly as `org-node-creation-fn', so that some -necessary variables are set." - (if (or (null org-node-proposed-title) - (null org-node-proposed-id)) - (message "noa/org-node-new-node is meant to be called indirectly") - (when (not (file-exists-p noa/org-notes-file)) - (user-error "Node file not found: %s" noa/org-notes-file)) - (find-file noa/org-notes-file) - (goto-char (point-max)) - (insert "* " org-node-proposed-title - "\n:PROPERTIES:" - "\n:ID: " org-node-proposed-id - "\n:END:" - "\n") - (goto-char (point-max)) - (push (current-buffer) org-node--not-yet-saved) - (run-hooks 'org-node-creation-hook))) - - :bind (("