From 44e8f02225444ac7de50120efc851821441adfc6 Mon Sep 17 00:00:00 2001 From: Inhji Date: Fri, 2 Feb 2024 09:28:35 +0100 Subject: [PATCH] Add org-auto-tangle, org-journal --- config/dot_config/doom/config.el | 34 ++++++------- config/dot_config/doom/config.org | 81 ++++++++++++++++++++++-------- config/dot_config/doom/init.el | 3 +- config/dot_config/doom/packages.el | 2 + 4 files changed, 79 insertions(+), 41 deletions(-) diff --git a/config/dot_config/doom/config.el b/config/dot_config/doom/config.el index e60597e..bc5b745 100644 --- a/config/dot_config/doom/config.el +++ b/config/dot_config/doom/config.el @@ -1,22 +1,14 @@ ;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- +;; config.el (setq user-full-name "Jonathan Jenne" user-mail-address "johnnie@posteo.de") +(setq shell-file-name (executable-find "bash")) + +(setq display-line-numbers-type t) (setq doom-theme 'doom-one) -;; This determines the style of line numbers in effect. If set to `nil', line -;; numbers are disabled. For relative line numbers, set this to `relative'. -(setq display-line-numbers-type t) - -;; If you use `org' and don't want your org files in the default location below, -;; change `org-directory'. It must be set before org loads! -(setq org-directory "~/Notes/Org") - -(after! org (setq +org-capture-notes-file "Notes.org" - +org-capture-todo-file "Todo.org")) - -;; Configure Org-Agenda (after! org (setq org-agenda-show-all-dates nil org-agenda-span 2 @@ -32,13 +24,19 @@ ;; Consider all org files part of the org-agenda org-agenda-files (list "~/Notes/Org"))) -;; Set bash as the default shell to run Emacs in since fish can cause problems -(setq shell-file-name (executable-find "bash")) +(setq org-auto-tangle-default nil) + +(after! org (setq +org-capture-notes-file "Notes.org" + +org-capture-todo-file "Todo.org")) + +(setq org-directory "~/Notes/Org") -;; Initialize org-modern (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) -(add-hook! org-mode :append - (lambda () (add-hook 'after-save-hook - #'org-babel-tangle :append :local))) +(setq org-journal-date-prefix "#+TITLE: " + org-journal-time-prefix "* " + org-journal-date-format "%a, %Y-%m-%d" + org-journal-file-format "%Y/%m/%Y-%m-%d.org" + org-journal-dir "~/Notes/Org/Journal") diff --git a/config/dot_config/doom/config.org b/config/dot_config/doom/config.org index b9e6f99..1bfdbd1 100644 --- a/config/dot_config/doom/config.org +++ b/config/dot_config/doom/config.org @@ -1,41 +1,52 @@ #+TITLE: Literate Doom Emacs Config #+AUTHOR: Inhji #+PROPERTY: header-args :tangle config.el +#+auto_tangle: t -Place your private configuration here! Remember, you do not need to run 'doom sync' after modifying this file! +* Table of contents :toc: +- [[#notes][Notes]] +- [[#base-setup][Base Setup]] +- [[#appearance][Appearance]] +- [[#org-mode][Org Mode]] + - [[#org-agenda][Org Agenda]] + - [[#org-auto-tangle][Org Auto Tangle]] + - [[#org-capture][Org Capture]] + - [[#org-directory][Org Directory]] + - [[#org-hooks][Org Hooks]] + - [[#org-journal][Org Journal]] + +* Notes + +Remember, you do not need to run 'doom sync' after modifying this file! * Base Setup +This codeblock should be the first in this file! + #+begin_src emacs-lisp ;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- +;; config.el #+end_src #+begin_src emacs-lisp (setq user-full-name "Jonathan Jenne" user-mail-address "johnnie@posteo.de") + +(setq shell-file-name (executable-find "bash")) #+end_src * Appearance #+begin_src emacs-lisp +(setq display-line-numbers-type t) (setq doom-theme 'doom-one) #+end_src -* Misc +* Org Mode + +** Org Agenda #+begin_src emacs-lisp -;; This determines the style of line numbers in effect. If set to `nil', line -;; numbers are disabled. For relative line numbers, set this to `relative'. -(setq display-line-numbers-type t) - -;; If you use `org' and don't want your org files in the default location below, -;; change `org-directory'. It must be set before org loads! -(setq org-directory "~/Notes/Org") - -(after! org (setq +org-capture-notes-file "Notes.org" - +org-capture-todo-file "Todo.org")) - -;; Configure Org-Agenda (after! org (setq org-agenda-show-all-dates nil org-agenda-span 2 @@ -50,16 +61,42 @@ Place your private configuration here! Remember, you do not need to run 'doom sy org-agenda-block-separator ?─ ;; Consider all org files part of the org-agenda org-agenda-files (list "~/Notes/Org"))) +#+end_src -;; Set bash as the default shell to run Emacs in since fish can cause problems -(setq shell-file-name (executable-find "bash")) +** Org Auto Tangle -;; Initialize org-modern +#+begin_src emacs-lisp +(setq org-auto-tangle-default nil) +#+end_src + +** Org Capture + +#+begin_src emacs-lisp +(after! org (setq +org-capture-notes-file "Notes.org" + +org-capture-todo-file "Todo.org")) +#+end_src + +** Org Directory + +#+begin_src emacs-lisp +(setq org-directory "~/Notes/Org") +#+end_src + +** Org Hooks + +#+begin_src emacs-lisp (add-hook 'org-mode-hook #'org-modern-mode) (add-hook 'org-agenda-finalize-hook #'org-modern-agenda) - -(add-hook! org-mode :append - (lambda () (add-hook 'after-save-hook - #'org-babel-tangle :append :local))) - +(add-hook 'org-mode-hook 'org-auto-tangle-mode) #+end_src + +** Org Journal + +#+begin_src emacs-lisp +(setq org-journal-date-prefix "#+TITLE: " + org-journal-time-prefix "* " + org-journal-date-format "%a, %Y-%m-%d" + org-journal-file-format "%Y/%m/%Y-%m-%d.org" + org-journal-dir "~/Notes/Org/Journal") +#+end_src + diff --git a/config/dot_config/doom/init.el b/config/dot_config/doom/init.el index 65c0e31..360a34d 100644 --- a/config/dot_config/doom/init.el +++ b/config/dot_config/doom/init.el @@ -154,7 +154,8 @@ ;;nim ; python + lisp at the speed of c ;;nix ; I hereby declare "nix geht mehr!" ;;ocaml ; an objective camel - org ; organize your plain life in plain text + (org ; organize your plain life in plain text + +journal) php ; perl's insecure younger brother ;;plantuml ; diagrams for confusing people more ;;purescript ; javascript, but functional diff --git a/config/dot_config/doom/packages.el b/config/dot_config/doom/packages.el index 38846b7..4ea1a09 100644 --- a/config/dot_config/doom/packages.el +++ b/config/dot_config/doom/packages.el @@ -10,6 +10,8 @@ ;; (package! some-package) (package! org-modern) +(package! org-auto-tangle) +(package! org-journal) ;; To install a package directly from a remote git repo, you must specify a ;; `:recipe'. You'll find documentation on what `:recipe' accepts here: