emacs: add config wide paths to important files

This commit is contained in:
Inhji 2024-02-05 13:22:49 +01:00
parent 210d7d37b5
commit ddc78add90
2 changed files with 68 additions and 29 deletions

View File

@ -1,14 +1,20 @@
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; config.el
(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"))
(setq display-line-numbers-type t)
(setq doom-theme 'doom-one)
(setq org-src-tab-acts-natively t)
(after! org (setq
org-agenda-show-all-dates nil
org-agenda-span 2
@ -22,21 +28,29 @@
"◀── now ──────────────────────────────────────────────── \\o/"
org-agenda-block-separator ?─
;; Consider all org files part of the org-agenda
org-agenda-files (list "~/Notes/Org")))
org-agenda-files (list +user-org-path)))
(setq org-auto-tangle-default nil)
(after! org (setq +org-capture-notes-file "Notes.org"
+org-capture-todo-file "Todo.org"))
(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)))
(setq org-directory "~/Notes/Org")
(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)))
(setq org-directory +user-org-path)
(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)
(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")

View File

@ -5,33 +5,37 @@
* Table of contents :toc:
- [[#notes][Notes]]
- [[#base-setup][Base Setup]]
- [[#config-basics][Config Basics]]
- [[#appearance][Appearance]]
- [[#org-mode][Org Mode]]
- [[#org-basics][Org Basics]]
- [[#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
* Config Basics
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 +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"))
#+end_src
@ -44,8 +48,17 @@ This codeblock should be the first in this file!
* Org Mode
** Org Basics
*** TAB uses the language's major-mode binding in code blocks
#+begin_src emacs-lisp
(setq org-src-tab-acts-natively t)
#+end_src
** 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.
#+begin_src emacs-lisp
(after! org (setq
org-agenda-show-all-dates nil
@ -60,26 +73,48 @@ This codeblock should be the first in this file!
"◀── now ──────────────────────────────────────────────── \\o/"
org-agenda-block-separator ?─
;; Consider all org files part of the org-agenda
org-agenda-files (list "~/Notes/Org")))
org-agenda-files (list +user-org-path)))
#+end_src
** Org Auto Tangle
Only tangle org files where it has been explicitly enabled, like this config file
#+begin_src emacs-lisp
(setq org-auto-tangle-default nil)
#+end_src
** Org Capture
*** Capture Files
#+begin_src emacs-lisp
(after! org (setq +org-capture-notes-file "Notes.org"
+org-capture-todo-file "Todo.org"))
(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)))
#+end_src
*** Capture Templates
#+begin_src emacs-lisp
(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)))
#+end_src
** Org Directory
#+begin_src emacs-lisp
(setq org-directory "~/Notes/Org")
(setq org-directory +user-org-path)
#+end_src
** Org Hooks
@ -90,13 +125,3 @@ This codeblock should be the first in this file!
(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