8.6 KiB
Writing
I am using Org mode1 extensively throughout my writing. Most of the improvements are done in the Core module, but all of the management, encryption, synchronization, and organization of all of my writing happens here.
Superstar
Make headline stars super with Org superstar mode2.
(use-package org-superstar :after org :hook (org-mode . org-superstar-mode))
Encryption
My source files are encrypted with symmetric key encryption via GPG3. This enables my workflow of storing my personal notes anywhere, including checked in to a public source repository. Emacs can cache the GPG3 password if you trust your session.
(setq epa-file-select-keys 2 epa-file-cache-passphrase-for-symmetric-encryption t epa-file-encrypt-to dotfiles/public-key)
Include *.gpg files
Override org-agenda-file-regexp
to include .org.gpg
files.
(unless (string-match-p "\\.gpg" org-agenda-file-regexp) (setq org-agenda-file-regexp (replace-regexp-in-string "\\\\\\.org" "\\\\.org\\\\(\\\\.gpg\\\\)?" org-agenda-file-regexp)))
Improvements
Real time checking and one-shot methods to check and correct common spelling and grammatical errors.
Spelling
Grammar
I use Writegood6 to find common writing problems such as cliches and poor wording. Grammarly for the peons!
(use-package writegood-mode :after org :config (writegood-mode))
Toggle Writegood mode with SPC t w
.
(dotfiles/leader "tw" '(writegood-mode :which-key "Grammar"))
Management
Download and install Org roam7, a plain text knowledge management system for Emacs built on top of Org mode1.
-
Notes can be arbitrarily referenced
-
Contexts created by linking topics and notes
(use-package org-roam :hook (after-init . org-roam-mode) :custom (org-roam-directory org-directory) (org-roam-encrypt-files t) (org-roam-capture-templates '()) (org-roam-dailies-capture-templates '()))
Configure custom keybindings behind SPC r
.
-
Find with
f
-
Buffer with
b
-
Capture with
c
(dotfiles/leader "r" '(:ignore t :which-key "Roam") "rf" '(org-roam-find-file :which-key "Find") "rc" '(org-roam-capture :which-key "Capture") "rb" '(org-roam-buffer-toggle-display :which-key "Buffer"))
Web visualizer
Including the extension Org roam server8 will run a web application that visualizes the Org roam7 database. Available whenever the editor is running at https://localhost:8080. The image at the top of this page is an example of the application running.
(use-package org-roam-server :hook (org-roam-mode . org-roam-server-mode))
Daily note taking
Use the daily
note feature of Org roam7 to capture daily notes. Create the default capture template with some preconfigured headers.
(with-eval-after-load 'org-roam (add-to-list 'org-roam-dailies-capture-templates '("d" "Default" entry (function org-roam-capture--get-point) "* %?" :file-name "docs/daily/%<%Y-%m-%d>" :head " ,#+TITLE: %<%Y-%m-%d> ,#+AUTHOR: Christopher James Hayward ,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil ,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil ")))
Place keybindings behind SPC r d
.
-
Date with
d
-
Today with
t
-
Tomorrow with
m
-
Yesterday with
y
(dotfiles/leader "rd" '(:ignore t :which-key "Dailies") "rdd" '(org-roam-dailies-find-date :which-key "Date") "rdt" '(org-roam-dailies-find-today :which-key "Today") "rdm" '(org-roam-dailies-find-tomorrow :which-key "Tomorrow") "rdy" '(org-roam-dailies-find-yesterday :which-key "Yesterday"))
Organization
More capture templates for Org roam7 are defined here in the context of specific domains and topics.
-
Configure agenda sources
(setq org-agenda-files '("~/.emacs.d/" "~/.emacs.d/docs/" "~/.emacs.d/docs/courses/" "~/.emacs.d/docs/daily/" "~/.emacs.d/docs/notes/" "~/.emacs.d/docs/posts/" "~/.emacs.d/docs/slides/" "~/.emacs.d/hosts/" "~/.emacs.d/modules/"))
-
Capture template for generic documents
(with-eval-after-load 'org-roam (add-to-list 'org-roam-capture-templates '("d" "Default" entry (function org-roam-capture--get-point) "%?" :file-name "docs/${slug}" :unnarrowed t :head " ,#+TITLE: ${title} ,#+AUTHOR: Christopher James Hayward ,#+EMAIL: chris@chrishayward.xyz ")))
-
Open an agenda buffer with
SPC a
(dotfiles/leader "a" '(org-agenda :which-key "Agenda"))
Courses
Custom capture template for courses.
-
Capture a new buffer with
SPC r c c
(with-eval-after-load 'org-roam (add-to-list 'org-roam-capture-templates '("c" "Course" plain (function org-roam-capture--get-point) "%?" :file-name "docs/courses/${slug}" :unnarrowed t :head " ,#+TITLE: ${title} ,#+SUBTITLE: ,#+AUTHOR: Christopher James Hayward ,#+EMAIL: chris@chrishayward.xyz ,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil ,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil ")))
Modules
Capture template for new modules for this project.
-
Capture a new buffer with
SPC r c m
-
Add buffers to agenda files
(with-eval-after-load 'org-roam (add-to-list 'org-agenda-files "~/.emacs.d/modules/") (add-to-list 'org-roam-capture-templates '("m" "Module" plain (function org-roam-capture--get-point) "%?" :file-name "modules/${slug}" :unnarrowed t :head " ,#+TITLE: ${title} ,#+AUTHOR: Christopher James Hayward ,#+EMAIL: chris@chrishayward.xyz ,#+PROPERTY: header-args:emacs-lisp :tangle core.el :comments org ,#+PROPERTY: header-args :results silent :eval no-export :comments org ,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil ,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil ")))
Hosts
Capture template for new host machines for this project. This does not cover machines that are controlled via TRAMP / SSH.
-
Capture a new buffer with
SPC r c h
(with-eval-after-load 'org-roam (add-to-list 'org-roam-capture-templates '("m" "Module" plain (function org-roam-capture--get-point) "%?" :file-name "modules/${slug}" :unnarrowed t :head " ,#+TITLE: ${title} ,#+AUTHOR: Christopher James Hayward ,#+EMAIL: chris@chrishayward.xyz ,#+PROPERTY: header-args:emacs-lisp :tangle core.el :comments org ,#+PROPERTY: header-args :results silent :eval no-export :comments org ,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil ,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil ")))