From dd8b3a666831c2575385c333c93af21107062b46 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Thu, 15 Feb 2024 12:01:36 +0000 Subject: [PATCH] Remove most top-level headings in config files Remove the headings that were used for each section, now that each section is in a different file Tweak org config to let org-agenda setup be where agenda files are added to org-refile-targets list, just in case --- config/defaults.org | 30 +++++++++---------- config/ide.org | 57 ++++++++++++++++++------------------ config/internet.org | 21 +++++++------- config/media.org | 3 +- config/org-mode.org | 70 ++++++++++++++++++++++----------------------- config/pass.org | 2 +- config/tramp.org | 6 ++-- config/ui.org | 22 +++++++------- 8 files changed, 102 insertions(+), 109 deletions(-) diff --git a/config/defaults.org b/config/defaults.org index 25aea7a..40c8e51 100644 --- a/config/defaults.org +++ b/config/defaults.org @@ -3,7 +3,7 @@ #+email: evie@xenia.me.uk #+filetags: :emacs:config:org: #+property: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent -* Common defaults + #+begin_src emacs-lisp (setq custom-file (locate-user-emacs-file "custom.el")) (when (and custom-file (file-exists-p custom-file)) @@ -64,7 +64,7 @@ (customize-set-variable 'compilation-scroll-output t) #+end_src -** Auto-save file settings +* Auto-save file settings #+begin_src emacs-lisp :tangle yes (setq backup-directory-alist '(("." . "~/.local/state/emacs/backups")) tramp-backup-directory-alist backup-directory-alist @@ -73,7 +73,7 @@ (savehist-mode +1) #+end_src -** Recent files +* Recent files #+begin_src emacs-lisp (use-package recentf :config @@ -83,7 +83,7 @@ (recentf-max-saved-items 2048)) #+end_src -** package-archive with priorities +* package-archive with priorities #+begin_src emacs-lisp :results output silent (when (require 'package nil :noerror) (add-to-list 'package-archives '("stable" . "https://stable.melpa.org/packages/")) @@ -94,12 +94,12 @@ ("stable" . 70) ("melpa" . 0)))) #+end_src -** diminish modes +* diminish modes #+begin_src emacs-lisp (use-package diminish :ensure t) #+end_src -** Authentication +* Authentication #+begin_src emacs-lisp (when (require 'auth-source nil :noerror) (setq auth-sources '("secrets:Login")) @@ -107,7 +107,7 @@ (auth-source-pass-enable))) #+end_src -** Helpful +* Helpful #+begin_src emacs-lisp ;; Make `describe-*' screens more helpful (use-package helpful @@ -125,7 +125,7 @@ (keymap-global-set "C-h K" #'describe-keymap) #+end_src -** Spell checking +* Spell checking #+begin_src emacs-lisp ;; turn on spell checking, if available. (when (and (require 'ispell nil :noerror) (executable-find ispell-program-name)) @@ -153,7 +153,7 @@ (setq consult-flyspell-always-check-buffer t))) #+end_src -** ibuffer +* ibuffer #+begin_src emacs-lisp (use-package ibuffer :ensure t @@ -168,7 +168,7 @@ (ibuffer-do-sort-by-project-file-relative)))))) #+end_src -** whitespace-mode +* whitespace-mode #+begin_src emacs-lisp (use-package whitespace :custom @@ -192,7 +192,7 @@ newline-mark))) #+end_src -** Link hint keymaps +* Link hint keymaps #+begin_src emacs-lisp (use-package link-hint :ensure t @@ -202,7 +202,7 @@ ("C-c l C-c" . link-hint-copy-all-link))) #+end_src -** Avy keymaps +* Avy keymaps #+begin_src emacs-lisp (use-package avy :ensure t @@ -213,14 +213,14 @@ ("C-c j l" . avy-goto-line))) #+end_src -** which-func config +* which-func config #+begin_src emacs-lisp (use-package which-func :ensure t :init (which-function-mode)) #+end_src -** Shells and terminals +* Shells and terminals #+begin_src emacs-lisp (use-package shell :bind (("C-c t s" . shell))) @@ -229,7 +229,7 @@ :bind (("C-c t e" . eshell))) #+end_src -** Web browser +* Web browser #+begin_src emacs-lisp :tangle yes (use-package eww :defer t diff --git a/config/ide.org b/config/ide.org index 1ce8f16..44e7e7a 100644 --- a/config/ide.org +++ b/config/ide.org @@ -3,8 +3,7 @@ #+email: evie@xenia.me.uk #+filetags: :emacs:config:org: #+property: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent -* Development Environment -** Miscellaneous + #+begin_src emacs-lisp (use-package rainbow-delimiters :ensure t @@ -18,13 +17,13 @@ :config (direnv-mode +1)) #+end_src -** Grand Unified Debugger +* Grand Unified Debugger #+begin_src emacs-lisp (with-eval-after-load 'gud (customize-set-variable 'gdb-many-windows t)) #+end_src -** Tree-sitter +* Tree-sitter Set treesit to fontify all elements, default was 3 (out of 4) #+begin_src emacs-lisp (use-package treesit @@ -43,7 +42,7 @@ Set treesit to fontify all elements, default was 3 (out of 4) (setq rust-ts-mode-hook rust-mode-hook)) #+end_src -** Eldoc +* Eldoc #+begin_src emacs-lisp :tangle yes (use-package eldoc :ensure t @@ -54,7 +53,7 @@ Set treesit to fontify all elements, default was 3 (out of 4) (eldoc-echo-area-use-multiline-p nil)) #+end_src -** Eglot LSP +* Eglot LSP #+begin_src emacs-lisp (use-package eglot :ensure t @@ -96,7 +95,7 @@ Set treesit to fontify all elements, default was 3 (out of 4) `((python-ts-mode python-mode) . ("pylsp")))) #+end_src -** Apheleia formatting +* Apheleia formatting #+begin_src emacs-lisp (use-package apheleia :ensure t @@ -110,7 +109,7 @@ Set treesit to fontify all elements, default was 3 (out of 4) (add-to-list 'apheleia-mode-alist '(python-ts-mode . ruff)) (add-to-list 'apheleia-mode-alist '(python-mode . ruff))) #+end_src -** Flymake +* Flymake #+begin_src emacs-lisp :tangle yes (use-package flymake :ensure t @@ -119,7 +118,7 @@ Set treesit to fontify all elements, default was 3 (out of 4) :hook (prog-mode . flymake-mode)) #+end_src -*** Diagnostics in popup +** Diagnostics in popup #+begin_src emacs-lisp :tangle yes (use-package flymake-popon :ensure t @@ -129,7 +128,7 @@ Set treesit to fontify all elements, default was 3 (out of 4) (global-flymake-popon-mode +1)) #+end_src -*** shellcheck +** shellcheck #+begin_src emacs-lisp (use-package flymake-shellcheck :ensure t @@ -138,7 +137,7 @@ Set treesit to fontify all elements, default was 3 (out of 4) :hook (sh-mode . flymake-shellcheck-load)) #+end_src -*** eslint +** eslint #+begin_src emacs-lisp (use-package flymake-eslint :ensure t @@ -146,7 +145,7 @@ Set treesit to fontify all elements, default was 3 (out of 4) :diminish :hook (js-ts-mode . flymake-eslint-enable)) #+end_src -*** ruff +** ruff #+begin_src emacs-lisp (use-package flymake-ruff :ensure t @@ -155,7 +154,7 @@ Set treesit to fontify all elements, default was 3 (out of 4) :hook (python-base-mode . flymake-ruff-load)) #+end_src -** Project +* Project #+begin_src emacs-lisp (setq project-switch-use-entire-map t project-switch-commands '((project-find-file "Find file") @@ -164,8 +163,8 @@ Set treesit to fontify all elements, default was 3 (out of 4) (project-vc-dir "VC-Dir") (project-eshell "Eshell"))) #+end_src -** Version control -*** Magit +* Version control +** Magit #+begin_src emacs-lisp (use-package magit :ensure t @@ -193,8 +192,8 @@ Set treesit to fontify all elements, default was 3 (out of 4) ("\\`\\(?:sourcehut:\\|sh:\\)\\([^:]+\\)\\'" "git.sr.ht" "sourcehut.user") ("\\`\\(?:gitea:\\|gt:\\)\\([^:]+\\)\\'" "git.xenia.me.uk" "gitea.user")))) #+end_src -** Completion -*** Vertico +* Completion +** Vertico #+begin_src emacs-lisp (use-package vertico :ensure t @@ -207,7 +206,7 @@ Set treesit to fontify all elements, default was 3 (out of 4) (require 'vertico-directory)) #+end_src -*** Marginalia +** Marginalia #+begin_src emacs-lisp (use-package marginalia :ensure t @@ -219,7 +218,7 @@ Set treesit to fontify all elements, default was 3 (out of 4) :config (marginalia-mode +1)) #+end_src -*** Orderless +** Orderless #+begin_src emacs-lisp (use-package orderless :ensure t @@ -230,7 +229,7 @@ Set treesit to fontify all elements, default was 3 (out of 4) (completion-category-overrides '((file (styles . (partial-completion)))))) #+end_src -*** Corfu and Cape +** Corfu and Cape #+begin_src emacs-lisp (use-package corfu :ensure t @@ -285,7 +284,7 @@ Set treesit to fontify all elements, default was 3 (out of 4) (add-to-list 'completion-at-point-functions #'cape-dabbrev)) #+end_src -*** Consult +** Consult #+begin_src emacs-lisp (use-package consult :ensure t @@ -318,7 +317,7 @@ Set treesit to fontify all elements, default was 3 (out of 4) :bind (("C-c s y" . consult-yasnippet))) #+end_src -*** Embark +** Embark #+begin_src emacs-lisp (use-package embark :ensure t @@ -333,7 +332,7 @@ Set treesit to fontify all elements, default was 3 (out of 4) :after (embark consult) :hook (embark-collect-mode . consult-preview-at-point-mode)) #+end_src -** Snippets +* Snippets #+begin_src emacs-lisp (use-package yasnippet-snippets :ensure t) @@ -351,7 +350,7 @@ Set treesit to fontify all elements, default was 3 (out of 4) :after yasnippet :init (add-to-list 'completion-at-point-functions #'yasnippet-capf)) #+end_src -** Aggressive Indent +* Aggressive Indent #+begin_src emacs-lisp (use-package aggressive-indent :ensure t @@ -361,8 +360,8 @@ Set treesit to fontify all elements, default was 3 (out of 4) lisp-data-mode rust-mode)) #+end_src -** Language-specific settings -*** Nix +* Language-specific settings +** Nix #+begin_src emacs-lisp (use-package nix-mode :mode "\\.nix\\'" @@ -371,13 +370,13 @@ Set treesit to fontify all elements, default was 3 (out of 4) (require 'nix-flake)) #+end_src -*** Nushell +** Nushell #+begin_src emacs-lisp (use-package nushell-ts-mode :mode "\\.nu\\'") #+end_src -*** Python +** Python Set fill column to 88 and enable display in python buffers #+begin_src emacs-lisp :tangle yes (defun my/enable-fill-column (col) @@ -394,7 +393,7 @@ Set fill column to 88 and enable display in python buffers (setq python-ts-mode-hook python-mode-hook)) #+end_src -*** Rust +** Rust #+begin_src emacs-lisp (use-package cargo :hook (rust-ts-mode . cargo-minor-mode)) diff --git a/config/internet.org b/config/internet.org index 9b5e6b4..8d4cc83 100644 --- a/config/internet.org +++ b/config/internet.org @@ -3,15 +3,14 @@ #+email: evie@xenia.me.uk #+filetags: :emacs:config:org: #+property: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent -* Internet -** Gnus +* Gnus #+begin_src emacs-lisp :tangle yes (use-package gnus :config (setq gnus-select-method '(nnnil))) #+end_src -** Email +* Email #+begin_src emacs-lisp (setq sendmail-program (executable-find "msmtp") send-mail-function #'sendmail-send-it @@ -74,7 +73,7 @@ ) #+end_src -*** Account contexts +** Account contexts #+begin_src emacs-lisp (with-eval-after-load 'mu4e (require 'mu4e-context) @@ -113,7 +112,7 @@ (mu4e-refile-folder . "/Outlook/Archive")))))) #+end_src -*** Modeline configuration +** Modeline configuration #+begin_src emacs-lisp (with-eval-after-load 'mu4e (require 'mu4e-modeline) @@ -124,7 +123,7 @@ (mu4e-modeline-mode +1)) #+end_src -*** Headers mode glyphs +** Headers mode glyphs #+begin_src emacs-lisp (with-eval-after-load 'mu4e (setq mu4e-search-full-label '("F" . "󱊖 ") @@ -158,7 +157,7 @@ mu4e-headers-thread-last-child-prefix '("└>" . "╰>"))) #+end_src -**** Custom marks +*** Custom marks #+begin_src emacs-lisp (with-eval-after-load 'mu4e (setq mu4e-marks '((refile :char @@ -273,20 +272,20 @@ (mu4e-error "No action for deferred mark"))))) #+end_src -*** Desktop notifications +** Desktop notifications #+begin_src emacs-lisp (with-eval-after-load 'mu4e (require 'mu4e-notification) (setq mu4e-notification-support t)) #+end_src -*** Org-mode integration +** Org-mode integration #+begin_src emacs-lisp (with-eval-after-load 'mu4e (require 'mu4e-org)) #+end_src -*** iCalendar integration +** iCalendar integration #+begin_src emacs-lisp (with-eval-after-load 'mu4e (require 'mu4e-icalendar) @@ -298,7 +297,7 @@ (gnus-icalendar-org-setup)) #+end_src -** Feeds +* Feeds #+begin_src emacs-lisp (let ((elfeed-base-directory "~/.elfeed")) (setq elfeed-db-directory (expand-file-name "db" elfeed-base-directory) diff --git a/config/media.org b/config/media.org index 2b038b8..532ef23 100644 --- a/config/media.org +++ b/config/media.org @@ -3,8 +3,7 @@ #+email: evie@xenia.me.uk #+filetags: :emacs:config:org: #+property: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent -* Media -** EMMS +* EMMS #+begin_src emacs-lisp (setq emms-mode-line-icon-enabled-p nil) (use-package emms diff --git a/config/org-mode.org b/config/org-mode.org index baef407..42017d2 100644 --- a/config/org-mode.org +++ b/config/org-mode.org @@ -3,7 +3,7 @@ #+email: evie@xenia.me.uk #+filetags: :emacs:config:org: #+property: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent -* Org-mode + For reference information, see [[https://orgmode.com][Org-mode website]] #+begin_src emacs-lisp :results output silent @@ -19,11 +19,7 @@ For reference information, see [[https://orgmode.com][Org-mode website]] org-refile-use-outline-path t org-refile-allow-creating-parent-nodes t org-refile-use-outline-path 'file - org-refile-targets '((nil :maxlevel . 2) - (org-agenda-files :maxlevel . 1) - ;; ((expand-file-name "journal" org-directory) :maxlevel . 1) - ;; ((expand-file-name "roam" org-directory) :maxlevel . 1) - (org-agenda-files :tag . "inbox"))) + org-refile-targets '((nil :maxlevel . 2))) ;; Visually indent org-mode files to a given header level (add-hook 'org-mode-hook #'org-indent-mode) @@ -35,7 +31,7 @@ For reference information, see [[https://orgmode.com][Org-mode website]] (python . t)))) #+end_src -** Keymaps +* Keymaps #+begin_src emacs-lisp :results output silent (keymap-global-set "C-c o ." #'calendar) (keymap-global-set "C-c o e" #'org-edit-src-code) @@ -44,7 +40,27 @@ For reference information, see [[https://orgmode.com][Org-mode website]] (keymap-global-set "C-c o l" #'org-capture-goto-last-stored) #+end_src -** org-roam +* Capture templates +#+begin_src emacs-lisp :results output silent + (setq org-capture-templates + '(("n" "Note" entry + (file+headline "notes.org" "Inbox") + "* %?") + ("t" "Task" entry + (file+headline "tasks.org" "Inbox") + "* TODO %?" + :prepend t) + ("r" "Reading List" entry + (file+headline "reading.org" "Inbox") + "* %?") + ("m" "Email Workflow") + ("mf" "Follow Up" entry (file+olp "mail.org" "Follow Up") + "* TODO Follow up with %:fromname on %a\nSCHEDULED:%t\nDEADLINE: %(org-insert-time-stamp (org-read-date nil t \"+2d\"))\n\n%i") + ("mr" "Read Later" entry (file+olp "mail.org" "Read Later") + "* TODO Read %:subject\nSCHEDULED:%t\nDEADLINE: %(org-insert-time-stamp (org-read-date nil t \"+2d\"))\n\n%a\n\n%i") + )) +#+end_src +* org-roam #+begin_src emacs-lisp (use-package org-roam :ensure t @@ -70,7 +86,7 @@ For reference information, see [[https://orgmode.com][Org-mode website]] (org-roam-db-autosync-mode +1)) #+end_src -** org-agenda +* org-agenda #+begin_src emacs-lisp :results output silent (setq org-agenda-span 'week org-agenda-start-on-weekday 1 @@ -86,10 +102,12 @@ For reference information, see [[https://orgmode.com][Org-mode website]] (let ((agenda-file (expand-file-name ".agenda" org-directory))) (if (file-exists-p agenda-file) - (setq org-agenda-files agenda-file))) + (list (setq org-agenda-files agenda-file) + (add-to-list 'org-refile-targets '(org-agenda-files :maxlevel . 1) t) + (add-to-list 'org-refile-targets '(org-agenda-files :tag . "inbox") t)))) #+end_src -** org-alert +* org-alert #+begin_src emacs-lisp (use-package org-alert :ensure t @@ -100,7 +118,7 @@ For reference information, see [[https://orgmode.com][Org-mode website]] org-alert-notify-after-event-cutoff 5) (org-alert-enable)) #+end_src -** org-journal +* org-journal #+begin_src emacs-lisp :results output silent (use-package org-journal :bind (("C-c o j" . org-journal-new-entry)) @@ -109,27 +127,7 @@ For reference information, see [[https://orgmode.com][Org-mode website]] (org-journal-file-type 'monthly) (org-journal-file-format "%Y-%m.org")) #+end_src -** Capture templates -#+begin_src emacs-lisp :results output silent - (setq org-capture-templates - '(("n" "Note" entry - (file+headline "notes.org" "Inbox") - "* %?") - ("t" "Task" entry - (file+headline "tasks.org" "Inbox") - "* TODO %?" - :prepend t) - ("r" "Reading List" entry - (file+headline "reading.org" "Inbox") - "* %?") - ("m" "Email Workflow") - ("mf" "Follow Up" entry (file+olp "mail.org" "Follow Up") - "* TODO Follow up with %:fromname on %a\nSCHEDULED:%t\nDEADLINE: %(org-insert-time-stamp (org-read-date nil t \"+2d\"))\n\n%i") - ("mr" "Read Later" entry (file+olp "mail.org" "Read Later") - "* TODO Read %:subject\nSCHEDULED:%t\nDEADLINE: %(org-insert-time-stamp (org-read-date nil t \"+2d\"))\n\n%a\n\n%i") - )) -#+end_src -** org-noter +* org-noter #+begin_src emacs-lisp (use-package org-noter :ensure t @@ -148,7 +146,7 @@ For reference information, see [[https://orgmode.com][Org-mode website]] (org-noter-prefer-root-as-file-level nil)) #+end_src -** Citar +* citar #+begin_src emacs-lisp :results output silent (use-package citar :ensure t @@ -209,7 +207,7 @@ For reference information, see [[https://orgmode.com][Org-mode website]] citar-indicator-cited-icons))) #+end_src -*** Citar Embark integration +** Citar Embark integration #+begin_src emacs-lisp (use-package citar-embark :ensure t @@ -219,7 +217,7 @@ For reference information, see [[https://orgmode.com][Org-mode website]] (citar-embark-mode +1)) #+end_src -*** LaTeX +** LaTeX #+begin_src emacs-lisp (setq org-latex-compiler "lualatex") (setq org-preview-latex-default-process 'dvisvgm) diff --git a/config/pass.org b/config/pass.org index 99490ee..74fb7ca 100644 --- a/config/pass.org +++ b/config/pass.org @@ -3,7 +3,7 @@ #+email: evie@xenia.me.uk #+filetags: :emacs:config:org: #+property: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent -* Password Store + #+begin_src emacs-lisp (use-package password-store :ensure t diff --git a/config/tramp.org b/config/tramp.org index a61732b..cbbe005 100644 --- a/config/tramp.org +++ b/config/tramp.org @@ -3,8 +3,7 @@ #+email: evie@xenia.me.uk #+filetags: :emacs:config:org: #+property: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent -* Remote Editing -** TRAMP + #+begin_src emacs-lisp :tangle yes (use-package tramp :defer t @@ -13,7 +12,7 @@ (add-to-list 'tramp-remote-path 'tramp-own-remote-path)) #+end_src -*** Connection variables +* Connection variables #+begin_src emacs-lisp (connection-local-set-profile-variables 'remote-disable-apheleia @@ -37,4 +36,3 @@ 'remote-disable-apheleia) #+end_src - diff --git a/config/ui.org b/config/ui.org index fd11905..3840437 100644 --- a/config/ui.org +++ b/config/ui.org @@ -3,7 +3,7 @@ #+email: evie@xenia.me.uk #+filetags: :emacs:config:org: #+property: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent -* UI + #+begin_src emacs-lisp (setq use-dialog-box nil truncate-lines nil @@ -43,7 +43,7 @@ (advice-add command :after #'pulse-line)) #+end_src -** Theme, font and nerd-icons +* Theme, font and nerd-icons #+begin_src emacs-lisp (add-to-list 'initial-frame-alist '(width . 120)) (add-to-list 'initial-frame-alist '(height . 80)) @@ -101,7 +101,7 @@ (keymap-global-set "C-c i n" #'nerd-icons-insert) #+end_src -*** Font ligatures +** Font ligatures #+begin_src emacs-lisp (use-package ligature :ensure t @@ -117,9 +117,9 @@ "/*" "*/" "+++" "