dotfiles/config/dot_config/doom/config.org

3.4 KiB

Literate Doom Emacs Config

Notes

Remember, you do not need to run 'doom sync' after modifying this file!

Config Basics

This codeblock should be the first in this file!

;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
(setq user-full-name "Jonathan Jenne"
      user-mail-address "johnnie@posteo.de")

(setq +user-org-path "~/Notes/Org"
      +user-org-todo-file "Todo.org"
      +user-org-notes-file "Notes.org"
      +user-org-journal-file "Journal.org")

(setq shell-file-name (executable-find "bash"))

Appearance

(setq display-line-numbers-type t)
(setq doom-theme 'doom-one)

Org Mode

Org Basics

TAB uses the language's major-mode binding in code blocks

(setq org-src-tab-acts-natively t)

Org Agenda

To have a less overwhelming agenda, show only TODOs for today and tomorrow. DONE items are not interesting, so they are also hidden.

(after! org (setq
        org-agenda-show-all-dates nil
        org-agenda-span 2
        org-agenda-start-day "+0d"
        org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)
        org-agenda-time-grid
        '((daily today require-timed)
          (800 1000 1200 1400 1600 1800 2000)
          " ┄┄┄┄┄ " "┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄")
        org-agenda-current-time-string
        "◀── now ──────────────────────────────────────────────── \\o/"
        org-agenda-block-separator ?─
        ;; Consider all org files part of the org-agenda
        org-agenda-files (list +user-org-path)))

Org Auto Tangle

Only tangle org files where it has been explicitly enabled, like this config file

(setq org-auto-tangle-default nil)

Org Capture

Capture Files

(after! org (setq +org-capture-notes-file (expand-file-name +user-org-notes-file +user-org-path)
                  +org-capture-todo-file (expand-file-name +user-org-todo-file +user-org-path)
                  +org-capture-journal-file (expand-file-name +user-org-journal-file +user-org-path)))

Capture Templates

(setq org-capture-templates
      '(("t" "Personal todo" entry
         (file+headline +org-capture-todo-file "Inbox")
         "* TODO %?\n" :prepend t)

        ("n" "Personal notes" entry
         (file+headline +org-capture-notes-file "Inbox")
         "* %u %?\n" :prepend t)

        ("j" "Journal" entry
         (file+olp+datetree +org-capture-journal-file)
         "* %U %?\n" :prepend t)))

Org Directory

(setq org-directory +user-org-path)

Org Hooks

(add-hook 'org-mode-hook #'org-modern-mode)
(add-hook 'org-agenda-finalize-hook #'org-modern-agenda)
(add-hook 'org-mode-hook 'org-auto-tangle-mode)