From 392c427263523cf640ef41c9d777a52404c42f0e Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 11 Jul 2025 11:43:55 -0400 Subject: [PATCH 01/63] Update README.md --- README.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/README.md b/README.md index 1c4989b..48a6a3f 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's - [Configuring org-mode](#configuring-org-mode) - [Configuring markdown-mode (e.g., README.md syntax)](#configuring-markdown-mode-eg-readmemd-syntax) - [Tree-sitter Integration (Better Syntax Highlighting)](#tree-sitter-integration-better-syntax-highlighting) + - [Auto upgrade Emacs packages](#auto-upgrade-emacs-packages) - [Treemacs, a tree layout file explorer (Sidebar file explorer)](#treemacs-a-tree-layout-file-explorer-sidebar-file-explorer) - [Inhibit the mouse](#inhibit-the-mouse) - [Spell checker](#spell-checker) @@ -965,6 +966,50 @@ To enable Tree-sitter, add the following to your `~/.emacs.d/post-init.el`: (global-treesit-auto-mode)) ``` +### Auto upgrade Emacs packages + +The `auto-package-update` package that automates the process of updating installed packages managed by *package.el*. Instead of requiring users to manually invoke `package-list-packages` and update each package, `auto-package-update` can check for available updates at regular intervals, perform updates in the background, and optionally hide the results buffer or prompt before applying changes. + +To configure **auto-package-update**, add the following to `~/.emacs.d/post-init.el`: + +```elisp +;; This automates the process of updating installed packages +(use-package auto-package-update + :ensure t + :custom + ;; Set the number of days between automatic updates. + ;; Here, packages will only be updated if at least 7 days have passed + ;; since the last successful update. + (auto-package-update-interval 7) + + ;; Suppress display of the *auto-package-update results* buffer after updates. + ;; This keeps the user interface clean and avoids unnecessary interruptions. + (auto-package-update-hide-results t) + + ;; Automatically delete old package versions after updates to reduce disk + ;; usage and keep the package directory clean. This prevents the accumulation + ;; of outdated files in Emacs’s package directory, which consume + ;; unnecessary disk space over time. + (auto-package-update-delete-old-versions t) + + ;; Uncomment the following line to enable a confirmation prompt + ;; before applying updates. This can be useful if you want manual control. + ;; (auto-package-update-prompt-before-update t) + + :config + ;; Run package updates automatically at startup, but only if the configured + ;; interval has elapsed. + (auto-package-update-maybe) + + ;; Schedule a background update attempt daily at 10:00 AM. + ;; This uses Emacs' internal timer system. If Emacs is running at that time, + ;; the update will be triggered. Otherwise, the update is skipped for that + ;; day. Note that this scheduled update is independent of + ;; `auto-package-update-maybe` and can be used as a complementary or + ;; alternative mechanism. + (auto-package-update-at-time "10:00")) +``` + ### Treemacs, a tree layout file explorer (Sidebar file explorer) The [treemacs](https://github.com/Alexander-Miller/treemacs) package is a file and project explorer for Emacs that provides a visually structured tree layout similar to file browsers in modern IDEs. It integrates well with various Emacs packages such as `projectile`, `lsp-mode`, and `magit`, allowing users to navigate their project structure efficiently. From 1e9e457d63f432f227d69c73c004de0422b05402 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 13 Jul 2025 15:06:51 -0400 Subject: [PATCH 02/63] Add: default-frame-scroll-bars --- early-init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/early-init.el b/early-init.el index 867bf29..48ec297 100644 --- a/early-init.el +++ b/early-init.el @@ -429,6 +429,7 @@ this stage of initialization." (push '(tool-bar-lines . 0) default-frame-alist) (setq tool-bar-mode nil)) +(setq default-frame-scroll-bars 'right) (push '(vertical-scroll-bars) default-frame-alist) (push '(horizontal-scroll-bars) default-frame-alist) (setq scroll-bar-mode nil) From a91000f8d4e2d48b93eff35b2403657c470c16f6 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 13 Jul 2025 15:14:43 -0400 Subject: [PATCH 03/63] Update GitHub actions --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33a3756..dbf93c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,9 @@ # name: CI -on: [push, pull_request] +on: + - workflow_dispatch + - pull_request jobs: test: From fb33cef88db40df7781b03369536cfc4024f01ff Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 13 Jul 2025 15:16:44 -0400 Subject: [PATCH 04/63] Release: 1.3.0 --- early-init.el | 2 +- init.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/early-init.el b/early-init.el index 48ec297..9c040e8 100644 --- a/early-init.el +++ b/early-init.el @@ -4,7 +4,7 @@ ;; URL: https://github.com/jamescherti/minimal-emacs.d ;; Package-Requires: ((emacs "29.1")) ;; Keywords: maint -;; Version: 1.2.1 +;; Version: 1.3.0 ;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Commentary: diff --git a/init.el b/init.el index 7500c5b..0455668 100644 --- a/init.el +++ b/init.el @@ -4,7 +4,7 @@ ;; URL: https://github.com/jamescherti/minimal-emacs.d ;; Package-Requires: ((emacs "29.1")) ;; Keywords: maint -;; Version: 1.2.1 +;; Version: 1.3.0 ;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Commentary: From 664c5746577afabc3428771697db65e4f5bbed7d Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 14 Jul 2025 14:04:38 -0400 Subject: [PATCH 05/63] Move pgtk-wait-for-event-timeout to early-init.el --- early-init.el | 5 +++++ init.el | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/early-init.el b/early-init.el index 9c040e8..f032939 100644 --- a/early-init.el +++ b/early-init.el @@ -218,6 +218,11 @@ pre-early-init.el, and post-early-init.el.") (when minimal-emacs-debug (setq message-log-max 16384)) +;; In PGTK, this timeout introduces latency. Reducing it from the default 0.1 +;; improves responsiveness of childframes and related packages. +(when (boundp 'pgtk-wait-for-event-timeout) + (setq pgtk-wait-for-event-timeout 0.001)) + ;;; Performance: Miscellaneous options ;; Font compacting can be very resource-intensive, especially when rendering diff --git a/init.el b/init.el index 0455668..e1f8f54 100644 --- a/init.el +++ b/init.el @@ -85,11 +85,6 @@ (setq visible-bell nil) (setq ring-bell-function #'ignore) -;; In PGTK, this timeout introduces latency. Reducing it from the default 0.1 -;; improves responsiveness of childframes and related packages. -(when (boundp 'pgtk-wait-for-event-timeout) - (setq pgtk-wait-for-event-timeout 0.001)) - ;;; Show-paren (setq show-paren-delay 0.1 From 2d63b234b2a87db3f0c3944982a58ed99e51f7e7 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 14 Jul 2025 14:09:31 -0400 Subject: [PATCH 06/63] Move ad-redefinition-action to early-init.el --- early-init.el | 3 +++ init.el | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/early-init.el b/early-init.el index f032939..9abbfb7 100644 --- a/early-init.el +++ b/early-init.el @@ -223,6 +223,9 @@ pre-early-init.el, and post-early-init.el.") (when (boundp 'pgtk-wait-for-event-timeout) (setq pgtk-wait-for-event-timeout 0.001)) +;; Disable warnings from the legacy advice API. They aren't useful. +(setq ad-redefinition-action 'accept) + ;;; Performance: Miscellaneous options ;; Font compacting can be very resource-intensive, especially when rendering diff --git a/init.el b/init.el index e1f8f54..5f435d6 100644 --- a/init.el +++ b/init.el @@ -38,11 +38,6 @@ (setq use-short-answers t) (advice-add 'yes-or-no-p :override #'y-or-n-p)) -;;; Features, warnings, and errors - -;; Disable warnings from the legacy advice API. They aren't useful. -(setq ad-redefinition-action 'accept) - ;;; Undo/redo (setq undo-limit (* 13 160000) From cfd29d40ccb6741c11b021c31977567a60b04b1b Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 14 Jul 2025 14:12:06 -0400 Subject: [PATCH 07/63] Move use-short-answers to early-init.el --- early-init.el | 10 ++++++++++ init.el | 12 ------------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/early-init.el b/early-init.el index 9abbfb7..5115c6c 100644 --- a/early-init.el +++ b/early-init.el @@ -226,6 +226,16 @@ pre-early-init.el, and post-early-init.el.") ;; Disable warnings from the legacy advice API. They aren't useful. (setq ad-redefinition-action 'accept) +;; Ask the user whether to terminate asynchronous compilations on exit. +;; This prevents native compilation from leaving temporary files in /tmp. +(setq native-comp-async-query-on-exit t) + +;; Allow for shorter responses: "y" for yes and "n" for no. +(setq read-answer-short t) +(if (boundp 'use-short-answers) + (setq use-short-answers t) + (advice-add 'yes-or-no-p :override #'y-or-n-p)) + ;;; Performance: Miscellaneous options ;; Font compacting can be very resource-intensive, especially when rendering diff --git a/init.el b/init.el index 5f435d6..d505341 100644 --- a/init.el +++ b/init.el @@ -26,18 +26,6 @@ (minimal-emacs-load-user-init "pre-init.el") (error "The early-init.el file failed to loaded")) -;;; Before package - -;; Ask the user whether to terminate asynchronous compilations on exit. -;; This prevents native compilation from leaving temporary files in /tmp. -(setq native-comp-async-query-on-exit t) - -;; Allow for shorter responses: "y" for yes and "n" for no. -(setq read-answer-short t) -(if (boundp 'use-short-answers) - (setq use-short-answers t) - (advice-add 'yes-or-no-p :override #'y-or-n-p)) - ;;; Undo/redo (setq undo-limit (* 13 160000) From f6814236afac46d5717e39527f94c1d710f539e1 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 14 Jul 2025 14:13:41 -0400 Subject: [PATCH 08/63] Revert "Move use-short-answers to early-init.el" This reverts commit cfd29d40ccb6741c11b021c31977567a60b04b1b. --- early-init.el | 10 ---------- init.el | 12 ++++++++++++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/early-init.el b/early-init.el index 5115c6c..9abbfb7 100644 --- a/early-init.el +++ b/early-init.el @@ -226,16 +226,6 @@ pre-early-init.el, and post-early-init.el.") ;; Disable warnings from the legacy advice API. They aren't useful. (setq ad-redefinition-action 'accept) -;; Ask the user whether to terminate asynchronous compilations on exit. -;; This prevents native compilation from leaving temporary files in /tmp. -(setq native-comp-async-query-on-exit t) - -;; Allow for shorter responses: "y" for yes and "n" for no. -(setq read-answer-short t) -(if (boundp 'use-short-answers) - (setq use-short-answers t) - (advice-add 'yes-or-no-p :override #'y-or-n-p)) - ;;; Performance: Miscellaneous options ;; Font compacting can be very resource-intensive, especially when rendering diff --git a/init.el b/init.el index d505341..5f435d6 100644 --- a/init.el +++ b/init.el @@ -26,6 +26,18 @@ (minimal-emacs-load-user-init "pre-init.el") (error "The early-init.el file failed to loaded")) +;;; Before package + +;; Ask the user whether to terminate asynchronous compilations on exit. +;; This prevents native compilation from leaving temporary files in /tmp. +(setq native-comp-async-query-on-exit t) + +;; Allow for shorter responses: "y" for yes and "n" for no. +(setq read-answer-short t) +(if (boundp 'use-short-answers) + (setq use-short-answers t) + (advice-add 'yes-or-no-p :override #'y-or-n-p)) + ;;; Undo/redo (setq undo-limit (* 13 160000) From 71ddbd4193bc917dc61e429ec0c9c7c39830d4c7 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 15 Jul 2025 12:37:54 -0400 Subject: [PATCH 09/63] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 48a6a3f..3523c17 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ The *minimal-emacs.d* project includes two initialization files: - `early-init.el`: Loaded early in the Emacs startup process, before the graphical interface is initialized. Introduced in Emacs 27, this file configures settings that influence startup performance and GUI behavior prior to package loading. - `init.el`: Loaded after the graphical interface is initialized. This file contains user customizations, including variable settings, package loading, mode configurations, and keybindings. +One of the primary motivations behind `minimal-emacs.d` is to offer alternative defaults that enhance usability and performance, addressing many suboptimal settings in Emacs that persist due to historical constraints and legacy compatibility. + ![](https://www.jamescherti.com/misc/screenshot-minimal-emacs-2.png) *(The theme shown in the screenshot above is ef-melissa-light, which is part of the ef-themes collection available on MELPA.)* ![](https://www.jamescherti.com/misc/screenshot-minimal-emacs-1.png) From 93bf23c18b98ac0aac443f9eb7f54d98b00b9f13 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 15 Jul 2025 12:52:12 -0400 Subject: [PATCH 10/63] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3523c17..c141981 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,9 @@ The *minimal-emacs.d* project includes two initialization files: - `early-init.el`: Loaded early in the Emacs startup process, before the graphical interface is initialized. Introduced in Emacs 27, this file configures settings that influence startup performance and GUI behavior prior to package loading. - `init.el`: Loaded after the graphical interface is initialized. This file contains user customizations, including variable settings, package loading, mode configurations, and keybindings. -One of the primary motivations behind `minimal-emacs.d` is to offer alternative defaults that enhance usability and performance, addressing many suboptimal settings in Emacs that persist due to historical constraints and legacy compatibility. +Excluding empty lines, comments, and docstrings, the minimal-emacs.d configuration is approximately 450 lines long. It does not introduce additional functionality beyond offering improved default settings. The user retains full control over which packages to install and which modes to enable. + +One of the primary motivations behind *minimal-emacs.d* is to offer alternative defaults that enhance usability and performance, addressing many suboptimal settings in Emacs that persist due to historical constraints and legacy compatibility. ![](https://www.jamescherti.com/misc/screenshot-minimal-emacs-2.png) *(The theme shown in the screenshot above is ef-melissa-light, which is part of the ef-themes collection available on MELPA.)* From ea7de0d889a2c2cefca417bc090f8f1467c17b81 Mon Sep 17 00:00:00 2001 From: Bruno Bigras <24027+bbigras@users.noreply.github.com> Date: Tue, 15 Jul 2025 13:58:34 -0400 Subject: [PATCH 11/63] README: remove duplicate `delete-selection-mode` line --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index c141981..ff22f46 100644 --- a/README.md +++ b/README.md @@ -1404,9 +1404,6 @@ fc-list : family | sed 's/,/\n/g' | sort -u ;; closing windows. (add-hook 'after-init-hook #'winner-mode) -;; Replace selected text with typed text -;; (delete-selection-mode 1) - (use-package uniquify :ensure nil :custom From fd6a9cafe8ccaa6fc6c05a9498d994100342bd6a Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 13 Jul 2025 19:12:53 -0400 Subject: [PATCH 12/63] Update README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index ff22f46..daf7649 100644 --- a/README.md +++ b/README.md @@ -1446,6 +1446,15 @@ fc-list : family | sed 's/,/\n/g' | sort -u (setq vc-make-backup-files t) (setq kept-old-versions 10) (setq kept-new-versions 10) + +;; When tooltip-mode is enabled, certain UI elements (e.g., help text, +;; mouse-hover hints) will appear as native system tooltips (pop-up windows), +;; rather than as echo area messages. This is useful in graphical Emacs sessions +;; where tooltips can appear near the cursor. +(setq tooltip-hide-delay 20) ; Time in seconds before a tooltip disappears (default: 10) +(setq tooltip-delay 0.4) ; Delay before showing a tooltip after mouse hover (default: 0.7) +(setq tooltip-short-delay 0.08) ; Delay before showing a short tooltip (Default: 0.1) +(tooltip-mode 1) ``` It is also recommended to read the following articles: From 2eaa865ed129d3ace130182195e65918babac53e Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 15 Jul 2025 15:00:36 -0400 Subject: [PATCH 13/63] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index daf7649..8e56168 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ The *minimal-emacs.d* project includes two initialization files: Excluding empty lines, comments, and docstrings, the minimal-emacs.d configuration is approximately 450 lines long. It does not introduce additional functionality beyond offering improved default settings. The user retains full control over which packages to install and which modes to enable. -One of the primary motivations behind *minimal-emacs.d* is to offer alternative defaults that enhance usability and performance, addressing many suboptimal settings in Emacs that persist due to historical constraints and legacy compatibility. +Emacs comes with many well-designed defaults, but it also retains some less-than-ideal settings, often due to historical constraints or legacy compatibility. The purpose of *minimal-emacs.d* is to offer refined defaults that improve both usability and performance, replacing long-standing Emacs settings that no longer serve modern workflows well. ![](https://www.jamescherti.com/misc/screenshot-minimal-emacs-2.png) *(The theme shown in the screenshot above is ef-melissa-light, which is part of the ef-themes collection available on MELPA.)* From 48d7ef686cf8d4663c24350ded5b6833ce171f14 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 15 Jul 2025 15:05:33 -0400 Subject: [PATCH 14/63] Update README.md --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 8e56168..b19ff9b 100644 --- a/README.md +++ b/README.md @@ -947,6 +947,21 @@ To configure **markdown-mode**, add the following to `~/.emacs.d/post-init.el`: This configuration sets up `markdown-mode` with deferred loading to improve startup performance. The `:commands` and `:mode` keywords ensure that the mode is loaded only when needed—for example, when opening `.md`, `.markdown`, or `README.md` files. Files named `README.md` are specifically associated with `gfm-mode`, which is for GitHub Flavored Markdown syntax. The `markdown-command` variable is set to `"multimarkdown"` to specify the Markdown processor used for previews and exports. Additionally, a keybinding (`C-c C-e`) is defined in `markdown-mode-map` to invoke `markdown-do`, which can be customized to perform common Markdown-related actions. +**Table of contents:** To automatically generate a table of contents when editing Markdown files, add the following to your `~/.emacs.d/post-init.el`: +```elisp +;; Automatically generate a table of contents when editing Markdown files +(use-package markdown-toc + :ensure t + :commands (markdown-toc-generate-toc + markdown-toc-generate-or-refresh-toc + markdown-toc-delete-toc + markdown-toc--toc-already-present-p) + :custom + (markdown-toc-header-toc-title "**Table of Contents**")) +``` + +The author also recommends reading the following article: [Emacs: Automating Table of Contents Update for Markdown Documents (e.g., README.md)](https://www.jamescherti.com/emacs-markdown-table-of-contents-update-before-save/). + ### Tree-sitter Integration (Better Syntax Highlighting) Tree-sitter is an incremental parsing system introduced in Emacs 29 that provides precise, high-performance syntax analysis and highlighting by constructing concrete syntax trees from source code. It supports a broad set of programming languages, including Bash, C, C++, C#, CMake, CSS, Dockerfile, Go, Java, JavaScript, JSON, Python, Rust, TOML, TypeScript, YAML, Elisp, Lua, Markdown, and many others. Unlike traditional font-lock, which relies on regular expressions, Tree-sitter uses formal grammar definitions to build real-time parse trees, enabling accurate syntax highlighting, structural navigation, code folding, and foundational support for advanced editing features like refactoring. From 4eb947f5344551db766d6de78b15f508123a1183 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 15 Jul 2025 15:07:44 -0400 Subject: [PATCH 15/63] Update README.md --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index b19ff9b..c064340 100644 --- a/README.md +++ b/README.md @@ -960,6 +960,19 @@ This configuration sets up `markdown-mode` with deferred loading to improve star (markdown-toc-header-toc-title "**Table of Contents**")) ``` +Once installed: + +* To **insert a table of contents** for the first time, run: + `M-x markdown-toc-generate-toc` + +* To **update an existing table of contents**, run: + `M-x markdown-toc-generate-or-refresh-toc` + +* To **remove an existing table of contents**, run: + `M-x markdown-toc-delete-toc` + +These commands work on any Markdown buffer and rely on properly formatted headers (e.g., `#`, `##`) to build the TOC. + The author also recommends reading the following article: [Emacs: Automating Table of Contents Update for Markdown Documents (e.g., README.md)](https://www.jamescherti.com/emacs-markdown-table-of-contents-update-before-save/). ### Tree-sitter Integration (Better Syntax Highlighting) From 3a52efc2854f59703834f61468d62cdc838a5e6c Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 15 Jul 2025 15:08:33 -0400 Subject: [PATCH 16/63] Update README.md --- README.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c064340..d4c2415 100644 --- a/README.md +++ b/README.md @@ -947,7 +947,7 @@ To configure **markdown-mode**, add the following to `~/.emacs.d/post-init.el`: This configuration sets up `markdown-mode` with deferred loading to improve startup performance. The `:commands` and `:mode` keywords ensure that the mode is loaded only when needed—for example, when opening `.md`, `.markdown`, or `README.md` files. Files named `README.md` are specifically associated with `gfm-mode`, which is for GitHub Flavored Markdown syntax. The `markdown-command` variable is set to `"multimarkdown"` to specify the Markdown processor used for previews and exports. Additionally, a keybinding (`C-c C-e`) is defined in `markdown-mode-map` to invoke `markdown-do`, which can be customized to perform common Markdown-related actions. -**Table of contents:** To automatically generate a table of contents when editing Markdown files, add the following to your `~/.emacs.d/post-init.el`: +**Table of contents:** To generate a table of contents when editing Markdown files, add the following to your `~/.emacs.d/post-init.el`: ```elisp ;; Automatically generate a table of contents when editing Markdown files (use-package markdown-toc @@ -962,16 +962,11 @@ This configuration sets up `markdown-mode` with deferred loading to improve star Once installed: -* To **insert a table of contents** for the first time, run: - `M-x markdown-toc-generate-toc` +- To **insert a table of contents** for the first time, run: `M-x markdown-toc-generate-toc` +- To **update an existing table of contents**, run: `M-x markdown-toc-generate-or-refresh-toc` +- To **remove an existing table of contents**, run: `M-x markdown-toc-delete-toc` -* To **update an existing table of contents**, run: - `M-x markdown-toc-generate-or-refresh-toc` - -* To **remove an existing table of contents**, run: - `M-x markdown-toc-delete-toc` - -These commands work on any Markdown buffer and rely on properly formatted headers (e.g., `#`, `##`) to build the TOC. +These commands work on any Markdown buffer and rely on properly formatted headers (e.g., `#`, `##`) to build the table of contents. The author also recommends reading the following article: [Emacs: Automating Table of Contents Update for Markdown Documents (e.g., README.md)](https://www.jamescherti.com/emacs-markdown-table-of-contents-update-before-save/). From 354341f853746d3b7f06d424266af006cf347aaa Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 15 Jul 2025 15:09:50 -0400 Subject: [PATCH 17/63] Update README.md --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index d4c2415..2190314 100644 --- a/README.md +++ b/README.md @@ -937,9 +937,6 @@ To configure **markdown-mode**, add the following to `~/.emacs.d/post-init.el`: :mode (("\\.markdown\\'" . markdown-mode) ("\\.md\\'" . markdown-mode) ("README\\.md\\'" . gfm-mode)) - :init - (setq markdown-command "multimarkdown") - :bind (:map markdown-mode-map ("C-c C-e" . markdown-do))) From 4923d1be740d91adab8b31143f218deed1969891 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 15 Jul 2025 15:12:41 -0400 Subject: [PATCH 18/63] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2190314..c1bef53 100644 --- a/README.md +++ b/README.md @@ -1782,6 +1782,7 @@ A drawback of using the early-init phase instead of init is that if a package fa - [Leading_Ad6415 commented on Reddit](https://www.reddit.com/r/emacs/comments/1feaf37/comment/lmw7ijd/) that after switching to *minimal-emacs.d*, their configuration execution time decreased from 3 seconds to just 1 second by simply replacing their `init.el` and `early-init.el` files with those from the project. - [Another user commented on Reddit](https://www.reddit.com/r/emacs/comments/1feaf37/comment/lrsfd64/), highlighting how a minimal-emacs.d significantly enhanced their Emacs performance. They reported substantial startup time reductions on both their main machine (from ~2.25 to ~0.95 seconds) and an older laptop (from ~2.95 to ~1.27 seconds) while also experiencing a generally snappier performance within Emacs. The user expressed gratitude for the project, calling it fantastic. - [Cyneox commented on Reddit](https://www.reddit.com/r/emacs/comments/1gh687a/comment/lwdv18t/), expressing gratitude for the resource and sharing their experience. They mentioned it was their fourth attempt to set up a vanilla configuration and highlighted that they had been using the repository as a foundation for their customizations over the past few days. They appreciated the absence of unexplained behavior and the clear instructions on where to place files. The user reported successful testing on both Linux and macOS, noting that everything functioned smoothly, including in the terminal. +- [Mlepnos1984](https://www.reddit.com/r/emacs/comments/1lz181i/comment/n2yjj17/): "I give you an A+ on documentation, the readme is great!" - [rrajath](https://www.reddit.com/r/emacs/comments/1ihn2tv/comment/mb0ja8k/) has been using the minimal-emacs.d config for the past several months and loves it. His previous setup used to take around 4 seconds to load, but with minimal-emacs.d, it now loads in just 1 second. - [LionyxML](https://www.reddit.com/r/emacs/comments/1ihn2tv/comment/mb35t9y/) considers that *minimal-emacs.d* contains one of the best README files he has ever read. The author of *minimal-emacs.d* found his comment encouraging. Reading this README.md is highly recommended for anyone looking to start customizing their *minimal-emacs.d* configuration. - [cyneox](https://www.reddit.com/r/emacs/comments/1ihn2tv/comment/mdnzgqx/): "Still using it and loving it! Thanks for the regular updates." From 1e19e3b72385f7a5062e6fb30b534a959fc347e0 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 15 Jul 2025 22:31:15 -0400 Subject: [PATCH 19/63] Update README.md --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c1bef53..83c5f8f 100644 --- a/README.md +++ b/README.md @@ -75,14 +75,16 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's - [Enhancing undo/redo](#enhancing-undoredo) - [Configuring Vim keybindings using Evil?](#configuring-vim-keybindings-using-evil) - [Configuring LSP Servers with Eglot (built-in)](#configuring-lsp-servers-with-eglot-built-in) - - [Session Management](#session-management) + - [Persisting and Restoring all buffers, windows/split, tab-bar, frames...](#persisting-and-restoring-all-buffers-windowssplit-tab-bar-frames) - [Configuring org-mode](#configuring-org-mode) - [Configuring markdown-mode (e.g., README.md syntax)](#configuring-markdown-mode-eg-readmemd-syntax) - [Tree-sitter Integration (Better Syntax Highlighting)](#tree-sitter-integration-better-syntax-highlighting) - [Auto upgrade Emacs packages](#auto-upgrade-emacs-packages) + - [Safely terminating unused buffers](#safely-terminating-unused-buffers) - [Treemacs, a tree layout file explorer (Sidebar file explorer)](#treemacs-a-tree-layout-file-explorer-sidebar-file-explorer) - [Inhibit the mouse](#inhibit-the-mouse) - [Spell checker](#spell-checker) + - [Efficient jumps for enhanced productivity](#efficient-jumps-for-enhanced-productivity) - [Asynchronous code formatting without cursor disruption](#asynchronous-code-formatting-without-cursor-disruption) - [A better Emacs *help* buffer](#a-better-emacs-help-buffer) - [Enhancing the Elisp development experience](#enhancing-the-elisp-development-experience) @@ -853,7 +855,7 @@ Here is an example of how to configure Eglot to enable or disable certain option :rope_autoimport (:enabled :json-false))))) ``` -### Session Management +### Persisting and Restoring all buffers, windows/split, tab-bar, frames... The [easysession](https://github.com/jamescherti/easysession.el) Emacs package is a session manager for Emacs that can persist and restore file editing buffers, indirect buffers/clones, Dired buffers, windows/splits, the built-in tab-bar (including tabs, their buffers, and windows), and Emacs frames. It offers a convenient and effortless way to manage Emacs editing sessions and utilizes built-in Emacs functions to persist and restore frames. @@ -1034,6 +1036,35 @@ To configure **auto-package-update**, add the following to `~/.emacs.d/post-init (auto-package-update-at-time "10:00")) ``` +### Safely terminating unused buffers + +The [buffer-terminator](https://github.com/jamescherti/buffer-terminator.el) Emacs package *automatically and safely kills buffers*, ensuring a clean and efficient workspace while *enhancing the performance of Emacs* by reducing open buffers, which minimizes active modes, timers, processes... + +Beyond performance, *buffer-terminator* provides other benefits. For instance, if you occasionally need to close annoying or unused buffers, *buffer-terminator* can handle this automatically, eliminating the need for manual intervention. (The default configuration is suitable for most users. However, the *buffer-terminator* package is highly customizable. You can define specific rules for retaining or terminating buffers by modifying the `buffer-terminator-rules-alist` with your preferred set of rules.) + +To configure **buffer-terminator**, add the following to `~/.emacs.d/post-init.el`: + +```emacs-lisp +(use-package buffer-terminator + :ensure t + :custom + ;; Enable/Disable verbose mode to log buffer cleanup events + (buffer-terminator-verbose nil) + + ;; Set the inactivity timeout (in seconds) after which buffers are considered + ;; inactive (default is 30 minutes): + (buffer-terminator-inactivity-timeout (* 30 60)) ; 30 minutes + + ;; Define how frequently the cleanup process should run (default is every 10 + ;; minutes): + (buffer-terminator-interval (* 10 60)) ; 10 minutes + + :config + (buffer-terminator-mode 1)) +``` + +(By default, *buffer-terminator* automatically determines which buffers are safe to terminate. However, if you need to define specific rules for keeping or terminating certain buffers, you can configure them using `buffer-terminator-rules-alist`.) + ### Treemacs, a tree layout file explorer (Sidebar file explorer) The [treemacs](https://github.com/Alexander-Miller/treemacs) package is a file and project explorer for Emacs that provides a visually structured tree layout similar to file browsers in modern IDEs. It integrates well with various Emacs packages such as `projectile`, `lsp-mode`, and `magit`, allowing users to navigate their project structure efficiently. @@ -1229,6 +1260,25 @@ To configure **flyspell**, add the following to `~/.emacs.d/post-init.el`: flyspell-prog-text-faces))) ``` +### Efficient jumps for enhanced productivity + +The [avy](https://github.com/abo-abo/avy) package is a navigation framework designed for jumping directly to any visible text on the screen with minimal keystrokes. The primary benefit of *avy* is a substantial increase in navigational efficiency, as it minimizes keystrokes compared to iterative methods like arrow keys or standard search. + +It operates by generating a dynamic, temporary mapping: upon invocation, such as with the command `avy-goto-char` or `avy-goto-char-2`, the user inputs a target character, and `avy` highlights all visible instances on the screen with unique key sequences. Typing the short sequence corresponding to the desired location instantly moves the point directly there. + +To configure **avy**, add the following to `~/.emacs.d/post-init.el`: +```elisp +(use-package avy + :ensure t + :commands (avy-goto-char + avy-goto-char-2 + avy-next) + :init + (global-set-key (kbd "C-'") 'avy-goto-char-2)) +``` + +The author recommends using `avy-goto-char-2` (typically bound to `C-'`). Upon invocation, *avy* prompts the user to input a two-character sequence. Subsequently, all visible instances of this sequence are highlighted with unique, concise labels (e.g., single letters or numbers). The user then simply presses the key corresponding to the desired label, and *avy* instantly transports the cursor to that specific occurrence. + ### Asynchronous code formatting without cursor disruption [Apheleia](https://github.com/radian-software/apheleia) is an Emacs package designed to run code formatters asynchronously without disrupting the cursor position. Code formatters like Shfmt, Black and Prettier ensure consistency and improve collaboration by automating formatting, but running them on save can introduce latency (e.g., Black takes around 200ms on an empty file) and unpredictably move the cursor when modifying nearby text. From 774d90ae2743a62ae032ac6dcb8814ea067352c9 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 16 Jul 2025 12:20:49 -0400 Subject: [PATCH 20/63] Update comment --- init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.el b/init.el index 5f435d6..6aa3067 100644 --- a/init.el +++ b/init.el @@ -325,7 +325,7 @@ (setq-default left-fringe-width 8) (setq-default right-fringe-width 8) -;; Do not show an arrow at the top/bottomin the fringe and empty lines +;; Disable visual indicators in the fringe for buffer boundaries and empty lines (setq-default indicate-buffer-boundaries nil) (setq-default indicate-empty-lines nil) From fa5655f34a60887653465a07f77b9c7323e40096 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Thu, 17 Jul 2025 11:52:46 -0400 Subject: [PATCH 21/63] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 83c5f8f..0eb6c36 100644 --- a/README.md +++ b/README.md @@ -1577,6 +1577,8 @@ The `straight.el` package is a declarative package manager for Emacs that aims t ### Configuring elpaca (package manager) +**NOTE:** When using the `:hook` keyword with `use-package`, replace `after-init` and `emacs-startup` with `elpaca-after-init`. Similarly, when using `add-hook`, replace `after-init-hook`, `emacs-startup-hook` with `elpaca-after-init-hook` to ensure they execute only after Elpaca has activated all queued packages. + Elpaca is a modern, asynchronous package manager for Emacs designed to be a drop-in replacement for `package.el` and `straight.el`, with enhanced performance and flexibility. Unlike traditional Emacs package managers, Elpaca installs packages asynchronously, allowing Emacs to remain responsive during installation and updates. Add to `~/.emacs.d/pre-early-init.el`: From 848829b3a0ff76cbac6efd404e37d64de284368c Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Thu, 17 Jul 2025 11:56:44 -0400 Subject: [PATCH 22/63] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0eb6c36..9d3f308 100644 --- a/README.md +++ b/README.md @@ -1577,7 +1577,7 @@ The `straight.el` package is a declarative package manager for Emacs that aims t ### Configuring elpaca (package manager) -**NOTE:** When using the `:hook` keyword with `use-package`, replace `after-init` and `emacs-startup` with `elpaca-after-init`. Similarly, when using `add-hook`, replace `after-init-hook`, `emacs-startup-hook` with `elpaca-after-init-hook` to ensure they execute only after Elpaca has activated all queued packages. +**NOTE:** If you choose to use the Elpaca package manager, it is recommended to replace `after-init` and `emacs-startup` with `elpaca-after-init` when using the `:hook` keyword in `use-package`. Likewise, when using `add-hook`, substitute `after-init-hook` and `emacs-startup-hook` with `elpaca-after-init-hook` to ensure execution occurs only after Elpaca has initialized all queued packages. Elpaca is a modern, asynchronous package manager for Emacs designed to be a drop-in replacement for `package.el` and `straight.el`, with enhanced performance and flexibility. Unlike traditional Emacs package managers, Elpaca installs packages asynchronously, allowing Emacs to remain responsive during installation and updates. From e58473385c2f8ba88c81caeeba0da576c72d1954 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Thu, 17 Jul 2025 12:28:08 -0400 Subject: [PATCH 23/63] Update README.md --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9d3f308..a5bd5a4 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's - [Spell checker](#spell-checker) - [Efficient jumps for enhanced productivity](#efficient-jumps-for-enhanced-productivity) - [Asynchronous code formatting without cursor disruption](#asynchronous-code-formatting-without-cursor-disruption) + - [Efficient template expansion with snippets](#efficient-template-expansion-with-snippets) - [A better Emacs *help* buffer](#a-better-emacs-help-buffer) - [Enhancing the Elisp development experience](#enhancing-the-elisp-development-experience) - [Showing the tab-bar](#showing-the-tab-bar) @@ -677,7 +678,7 @@ To enable **stripspace** and automatically delete trailing whitespace, add the f ### Enhancing undo/redo -The undo-fu package is a lightweight wrapper around Emacs' built-in undo system, providing more convenient undo/redo functionality while preserving access to the full undo history. The undo-fu-session package complements undo-fu by enabling the saving and restoration of undo history across Emacs sessions, even after restarting. +The [undo-fu](https://codeberg.org/ideasman42/emacs-undo-fu) package is a lightweight wrapper around Emacs' built-in undo system, providing more convenient undo/redo functionality while preserving access to the full undo history. The [undo-fu-session](https://codeberg.org/ideasman42/emacs-undo-fu-session) package complements undo-fu by enabling the saving and restoration of undo history across Emacs sessions, even after restarting. The default undo system in Emacs has two main issues that undo-fu fixes: @@ -1298,9 +1299,50 @@ To configure **apheleia**, add the following to `~/.emacs.d/post-init.el`: :hook ((prog-mode . apheleia-mode))) ``` +### Efficient template expansion with snippets + +The [yasnippet](https://github.com/joaotavora/yasnippet) package provides a template system that enhances text editing by enabling users to define and use snippets, which are predefined templates of code or text. When a user types a short abbreviation, YASnippet automatically expands it into a full template, which can include placeholders, fields, and dynamic content. This reduces repetitive typing and helps maintain consistency in coding or writing. + +The [yasnippet-snippets](https://github.com/AndreaCrotti/yasnippet-snippets) package with a comprehensive collection of bundled templates for numerous programming and markup languages, including C, C++, C#, Perl, Python, Ruby, SQL, LaTeX, HTML, CSS... + +(NOTE: Users of UltiSnips, a popular snippet engine for Vim, can export their snippets to YASnippet format using the tool [ultyas](https://github.com/jamescherti/ultyas)) + + +```elisp +;; The official collection of snippets for yasnippet. +(use-package yasnippet-snippets + :ensure t + :after yasnippet) + +;; YASnippet is a template system designed that enhances text editing by +;; enabling users to define and use snippets. When a user types a short +;; abbreviation, YASnippet automatically expands it into a full template, which +;; can include placeholders, fields, and dynamic content. +(use-package yasnippet + :ensure t + :commands (yas-minor-mode + yas-global-mode) + + :hook + (after-init . yas-global-mode) + + :custom + (yas-also-auto-indent-first-line t) ; Indent first line of snippet + (yas-also-indent-empty-lines t) + (yas-snippet-revival nil) ; Setting this to t causes issues with undo + (yas-wrap-around-region nil) ; Do not wrap region when expanding snippets + ;; (yas-triggers-in-field nil) ; Disable nested snippet expansion + ;; (yas-indent-line 'fixed) ; Do not auto-indent snippet content + ;; (yas-prompt-functions '(yas-no-prompt)) ; No prompt for snippet choices + + :init + ;; Suppress verbose messages + (setq yas-verbosity 0)) +``` + ### A better Emacs *help* buffer -Helpful is an alternative to the built-in Emacs help that provides much more contextual information. +[Helpful](https://github.com/Wilfred) is an alternative to the built-in Emacs help that provides much more contextual information. To configure **helpful**, add the following to `~/.emacs.d/post-init.el`: ```emacs-lisp @@ -1525,6 +1567,15 @@ fc-list : family | sed 's/,/\n/g' | sort -u (setq tooltip-delay 0.4) ; Delay before showing a tooltip after mouse hover (default: 0.7) (setq tooltip-short-delay 0.08) ; Delay before showing a short tooltip (Default: 0.1) (tooltip-mode 1) + +;; Configure the built-in Emacs server to start after initialization, +;; allowing the use of the emacsclient command to open files in the +;; current session. +(use-package server + :ensure nil + :commands server-start + :hook + (after-init . server-start)) ``` It is also recommended to read the following articles: From c06f8a2db9f26e4231b3b94312c235b834aac3cf Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Thu, 17 Jul 2025 12:29:50 -0400 Subject: [PATCH 24/63] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a5bd5a4..d14b6cd 100644 --- a/README.md +++ b/README.md @@ -1301,7 +1301,7 @@ To configure **apheleia**, add the following to `~/.emacs.d/post-init.el`: ### Efficient template expansion with snippets -The [yasnippet](https://github.com/joaotavora/yasnippet) package provides a template system that enhances text editing by enabling users to define and use snippets, which are predefined templates of code or text. When a user types a short abbreviation, YASnippet automatically expands it into a full template, which can include placeholders, fields, and dynamic content. This reduces repetitive typing and helps maintain consistency in coding or writing. +The [yasnippet](https://github.com/joaotavora/yasnippet) package provides a template system that enhances text editing by enabling users to define and use snippets, which are predefined templates of code or text. The user triggers snippet expansion by pressing the Tab key after typing an abbreviation, such as `if`. Upon pressing Tab, YASnippet replaces the abbreviation with the corresponding full template, allowing the user to fill in placeholders or fields within the expanded snippet. The [yasnippet-snippets](https://github.com/AndreaCrotti/yasnippet-snippets) package with a comprehensive collection of bundled templates for numerous programming and markup languages, including C, C++, C#, Perl, Python, Ruby, SQL, LaTeX, HTML, CSS... From ec68117c93158403b59f5eb6324fed0d571cecec Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Thu, 17 Jul 2025 12:32:38 -0400 Subject: [PATCH 25/63] Update README.md --- README.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index d14b6cd..d3284f0 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's - [Debug on error](#debug-on-error) - [Customizations: UI (pre-early-init.el)](#customizations-ui-pre-early-initel) - [How to enable the menu-bar, the tool-bar, dialogs, the contextual menu, and tooltips?](#how-to-enable-the-menu-bar-the-tool-bar-dialogs-the-contextual-menu-and-tooltips) + - [Reducing clutter in `~/.emacs.d` by redirecting files to `~/.emacs.d/var/`](#reducing-clutter-in-emacsd-by-redirecting-files-to-emacsdvar) - [Customizations: Packages (post-init.el)](#customizations-packages-post-initel) - [Optimization: Native Compilation](#optimization-native-compilation) - [How to activate recentf, savehist, saveplace, and auto-revert?](#how-to-activate-recentf-savehist-saveplace-and-auto-revert) @@ -94,7 +95,6 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's - [Changing the Default Font](#changing-the-default-font) - [Which other customizations can be interesting to add?](#which-other-customizations-can-be-interesting-to-add) - [Customizations: pre-early-init.el](#customizations-pre-early-initel) - - [Reducing clutter in `~/.emacs.d` by redirecting files to `~/.emacs.d/var/`](#reducing-clutter-in-emacsd-by-redirecting-files-to-emacsdvar) - [Configuring straight.el](#configuring-straightel) - [Configuring elpaca (package manager)](#configuring-elpaca-package-manager) - [Frequently asked questions](#frequently-asked-questions) @@ -201,6 +201,23 @@ To customize your Emacs setup to include various user interface elements, you ca These settings control the visibility of dialogs, context menus, toolbars, menu bars, and tooltips. +### Reducing clutter in `~/.emacs.d` by redirecting files to `~/.emacs.d/var/` + +Emacs, by default, stores various configuration files, caches, backups, and other data in the `~/.emacs.d` directory. Over time, this directory can become cluttered with numerous files, making it difficult to manage and maintain. + +A common solution to this issue is installing the no-littering package; however, this package is not essential. + +An alternative lightweight approach is to simply change the default `~/.emacs.d` directory to `~/.emacs.d/var/`, which will contain all the files that Emacs typically stores in the base directory. This can be accomplished by adding the following code to `~/.emacs.d/pre-early-init.el`: +``` emacs-lisp +;; Reducing clutter in ~/.emacs.d by redirecting files to ~/.emacs.d/var/ +;; IMPORTANT: This part should be in the pre-early-init.el file +(setq minimal-emacs-var-dir (expand-file-name "var/" minimal-emacs-user-directory)) +(setq package-user-dir (expand-file-name "elpa" minimal-emacs-var-dir)) +(setq user-emacs-directory minimal-emacs-var-dir) +``` + +**IMPORTANT:** The code above should be added to `~/.emacs.d/pre-early-init.el`, not the other files, as it modifies the behavior of all subsequent init files. + ## Customizations: Packages (post-init.el) This README.md offers guidance on installing optional external packages. While Emacs and minimal-emacs.d are fully functional without them, the recommended packages can enhance your experience and introduce additional features, which is why they are suggested. @@ -1585,23 +1602,6 @@ It is also recommended to read the following articles: ## Customizations: pre-early-init.el -### Reducing clutter in `~/.emacs.d` by redirecting files to `~/.emacs.d/var/` - -Emacs, by default, stores various configuration files, caches, backups, and other data in the `~/.emacs.d` directory. Over time, this directory can become cluttered with numerous files, making it difficult to manage and maintain. - -A common solution to this issue is installing the no-littering package; however, this package is not essential. - -An alternative lightweight approach is to simply change the default `~/.emacs.d` directory to `~/.emacs.d/var/`, which will contain all the files that Emacs typically stores in the base directory. This can be accomplished by adding the following code to `~/.emacs.d/pre-early-init.el`: -``` emacs-lisp -;; Reducing clutter in ~/.emacs.d by redirecting files to ~/.emacs.d/var/ -;; IMPORTANT: This part should be in the pre-early-init.el file -(setq minimal-emacs-var-dir (expand-file-name "var/" minimal-emacs-user-directory)) -(setq package-user-dir (expand-file-name "elpa" minimal-emacs-var-dir)) -(setq user-emacs-directory minimal-emacs-var-dir) -``` - -**IMPORTANT:** The code above should be added to `~/.emacs.d/pre-early-init.el`, not the other files, as it modifies the behavior of all subsequent init files. - ### Configuring straight.el The `straight.el` package is a declarative package manager for Emacs that aims to replace traditional systems like `package.el` by providing more precise control over package installation and management. Unlike `package.el`, which relies on downloading pre-built packages from ELPA archives, `straight.el` clones packages directly from their source repositories (typically Git), enabling reproducible and fully source-controlled package configurations. From 720618eed6e6a4b0acc297815368613ab5706993 Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Sat, 19 Jul 2025 07:46:41 +0200 Subject: [PATCH 26/63] Add missing repo fragment to Helpful URL --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d3284f0..22031ef 100644 --- a/README.md +++ b/README.md @@ -1359,7 +1359,7 @@ The [yasnippet-snippets](https://github.com/AndreaCrotti/yasnippet-snippets) pac ### A better Emacs *help* buffer -[Helpful](https://github.com/Wilfred) is an alternative to the built-in Emacs help that provides much more contextual information. +[Helpful](https://github.com/Wilfred/helpful) is an alternative to the built-in Emacs help that provides much more contextual information. To configure **helpful**, add the following to `~/.emacs.d/post-init.el`: ```emacs-lisp From 795bac632434abc653e436a6fce7d27303dc365d Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Sat, 19 Jul 2025 07:53:41 +0200 Subject: [PATCH 27/63] Adjust capitalization for Elpaca as a project --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d3284f0..caf026c 100644 --- a/README.md +++ b/README.md @@ -1626,7 +1626,7 @@ The `straight.el` package is a declarative package manager for Emacs that aims t (load bootstrap-file nil 'nomessage)) ``` -### Configuring elpaca (package manager) +### Configuring Elpaca (package manager) **NOTE:** If you choose to use the Elpaca package manager, it is recommended to replace `after-init` and `emacs-startup` with `elpaca-after-init` when using the `:hook` keyword in `use-package`. Likewise, when using `add-hook`, substitute `after-init-hook` and `emacs-startup-hook` with `elpaca-after-init-hook` to ensure execution occurs only after Elpaca has initialized all queued packages. @@ -1640,7 +1640,7 @@ Add to `~/.emacs.d/pre-early-init.el`: (setq minimal-emacs-package-initialize-and-refresh nil) ``` -And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=readme-ov-file#installer) to `~/.emacs.d/pre-init.el`: +And [add the Elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=readme-ov-file#installer) to `~/.emacs.d/pre-init.el`: ```elisp ;; Elpaca bootstrap (defvar elpaca-installer-version 0.11) From a03316a315d4835bf0f089a3a5f06c9a7350a963 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 18 Jul 2025 18:24:38 -0400 Subject: [PATCH 28/63] Update README.md --- README.md | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 08ec989..5aaafb4 100644 --- a/README.md +++ b/README.md @@ -209,11 +209,28 @@ A common solution to this issue is installing the no-littering package; however, An alternative lightweight approach is to simply change the default `~/.emacs.d` directory to `~/.emacs.d/var/`, which will contain all the files that Emacs typically stores in the base directory. This can be accomplished by adding the following code to `~/.emacs.d/pre-early-init.el`: ``` emacs-lisp -;; Reducing clutter in ~/.emacs.d by redirecting files to ~/.emacs.d/var/ -;; IMPORTANT: This part should be in the pre-early-init.el file -(setq minimal-emacs-var-dir (expand-file-name "var/" minimal-emacs-user-directory)) -(setq package-user-dir (expand-file-name "elpa" minimal-emacs-var-dir)) -(setq user-emacs-directory minimal-emacs-var-dir) +;;; Reducing clutter in ~/.emacs.d by redirecting files to ~/.emacs.d/var/ +;; NOTE: This must be placed in 'pre-early-init.el'. +(setq user-emacs-directory (expand-file-name "var/" minimal-emacs-user-directory)) +(setq package-user-dir (expand-file-name "elpa" user-emacs-directory)) +``` + +It is also useful to ensure that Emacs consistently utilizes the specified ELN cache directory for native compilation, thereby preventing it from generating or loading .eln files in the default system or user-standard locations. This guarantees that both the loading and writing of native-compiled files occur exclusively within the user-defined cache directory, avoiding permission issues and path inconsistencies. Add the following code to `~/.emacs.d/pre-early-init.el` +``` emacs-lisp +;; NOTE: This must be placed in 'pre-early-init.el'. +(when (featurep 'native-compile) + ;; Ensure Emacs consistently uses the specified ELN cache directory for native + ;; compilation, preventing it from creating or loading .eln files in the + ;; default system or user-standard paths. This guarantees that both loading + ;; and writing of native-compiled files happen exclusively in the user-defined + ;; cache directory, avoiding permission issues and path inconsistencies. + (let ((eln-cache-dir (convert-standard-filename + (expand-file-name "eln-cache" user-emacs-directory)))) + (when (boundp 'native-comp-eln-load-path) + (setcar native-comp-eln-load-path eln-cache-dir)) + (setq native-compile-target-directory eln-cache-dir) + (when (fboundp 'startup-redirect-eln-cache) + (startup-redirect-eln-cache eln-cache-dir)))) ``` **IMPORTANT:** The code above should be added to `~/.emacs.d/pre-early-init.el`, not the other files, as it modifies the behavior of all subsequent init files. @@ -1628,7 +1645,7 @@ The `straight.el` package is a declarative package manager for Emacs that aims t ### Configuring Elpaca (package manager) -**NOTE:** If you choose to use the Elpaca package manager, it is recommended to replace `after-init` and `emacs-startup` with `elpaca-after-init` when using the `:hook` keyword in `use-package`. Likewise, when using `add-hook`, substitute `after-init-hook` and `emacs-startup-hook` with `elpaca-after-init-hook` to ensure execution occurs only after Elpaca has initialized all queued packages. +**NOTE:** When using the `:hook` keyword with `use-package`, replace `after-init` and `emacs-startup` with `elpaca-after-init`. Similarly, when using `add-hook`, replace `after-init-hook`, `emacs-startup-hook` with `elpaca-after-init-hook` to ensure they execute only after Elpaca has activated all queued packages. Elpaca is a modern, asynchronous package manager for Emacs designed to be a drop-in replacement for `package.el` and `straight.el`, with enhanced performance and flexibility. Unlike traditional Emacs package managers, Elpaca installs packages asynchronously, allowing Emacs to remain responsive during installation and updates. From e1b96e84b0ef91f574d2bdca1d95e64744b365c4 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 21 Jul 2025 11:24:40 -0400 Subject: [PATCH 29/63] vc-git-diff-switches: Ensure git drivers are invoked --- init.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 6aa3067..090be47 100644 --- a/init.el +++ b/init.el @@ -173,7 +173,12 @@ (setq vc-git-print-log-follow t) (setq vc-make-backup-files nil) ; Do not backup version controlled files -(setq vc-git-diff-switches '("--histogram")) ; Faster algorithm for diffing. +(setq vc-git-diff-switches + '("--histogram" ;; Faster algorithm for diffing. + ;; --textconv ensures that custom diff drivers defined in .gitattributes + ;; are correctly invoked, so that vc-diff displays the expected output. + ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=79050 + "--textconv")) ;;; Auto save From cb359641da7ffc84bcfd72585291205d8f900271 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 22 Jul 2025 09:35:09 -0400 Subject: [PATCH 30/63] vc-git-diff-switches: Ensure git drivers are invoked --- init.el | 1 - 1 file changed, 1 deletion(-) diff --git a/init.el b/init.el index 090be47..c36d88e 100644 --- a/init.el +++ b/init.el @@ -177,7 +177,6 @@ '("--histogram" ;; Faster algorithm for diffing. ;; --textconv ensures that custom diff drivers defined in .gitattributes ;; are correctly invoked, so that vc-diff displays the expected output. - ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=79050 "--textconv")) ;;; Auto save From 6b2c03a9186cb9b095edc13e0979b01ffcf03648 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 22 Jul 2025 09:47:20 -0400 Subject: [PATCH 31/63] Update vc-git-diff-switches --- init.el | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/init.el b/init.el index c36d88e..6aa3067 100644 --- a/init.el +++ b/init.el @@ -173,11 +173,7 @@ (setq vc-git-print-log-follow t) (setq vc-make-backup-files nil) ; Do not backup version controlled files -(setq vc-git-diff-switches - '("--histogram" ;; Faster algorithm for diffing. - ;; --textconv ensures that custom diff drivers defined in .gitattributes - ;; are correctly invoked, so that vc-diff displays the expected output. - "--textconv")) +(setq vc-git-diff-switches '("--histogram")) ; Faster algorithm for diffing. ;;; Auto save From 641d3c33e56ddffb335bed01b6c8118273d37ea5 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 23 Jul 2025 19:00:29 -0400 Subject: [PATCH 32/63] Update README.md --- README.md | 25 +++++++++++++++---------- early-init.el | 1 + 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 5aaafb4..e20c1d5 100644 --- a/README.md +++ b/README.md @@ -91,12 +91,12 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's - [A better Emacs *help* buffer](#a-better-emacs-help-buffer) - [Enhancing the Elisp development experience](#enhancing-the-elisp-development-experience) - [Showing the tab-bar](#showing-the-tab-bar) - - [Preventing Emacs from saving custom.el](#preventing-emacs-from-saving-customel) - [Changing the Default Font](#changing-the-default-font) + - [Loading the custom.el file](#loading-the-customel-file) - [Which other customizations can be interesting to add?](#which-other-customizations-can-be-interesting-to-add) - [Customizations: pre-early-init.el](#customizations-pre-early-initel) - [Configuring straight.el](#configuring-straightel) - - [Configuring elpaca (package manager)](#configuring-elpaca-package-manager) + - [Configuring Elpaca (package manager)](#configuring-elpaca-package-manager) - [Frequently asked questions](#frequently-asked-questions) - [Customizing Scroll Recentering](#customizing-scroll-recentering) - [How to display Emacs startup duration?](#how-to-display-emacs-startup-duration) @@ -1466,14 +1466,6 @@ Configure the `tab-bar-show` variable to 1 to display the tab bar exclusively wh (setopt tab-bar-show 1) ``` -### Preventing Emacs from saving custom.el - -To prevent Emacs from saving customization information to a custom file, set `custom-file` to `null-device` by adding to the following to `~/.emacs.d/post-init.el`: -``` emacs-lisp -;; Prevent Emacs from saving customization information to a custom file -(setq custom-file null-device) -``` - ### Changing the Default Font To customize the default font, add the following expression to your `~/.emacs.d/post-init.el`: @@ -1493,6 +1485,19 @@ On Linux, you can display a comprehensive list of all installed font families by fc-list : family | sed 's/,/\n/g' | sort -u ``` +### Loading the custom.el file + +In Emacs, customization variables modified via the UI (e.g., `M-x customize`) are typically stored in a separate file, commonly named `custom.el`. To ensure these settings are loaded during Emacs initialization, it is necessary to explicitly load this file if it exists. + +To accomplish this, add the following form to your `~/.emacs.d/post-init.el`: + +```elisp +(when (file-exists-p custom-file) + (load custom-file)) +``` + +This ensures that any user-defined customizations are applied without interfering with manually maintained configuration files. + ### Which other customizations can be interesting to add? 1. Read the following article from the same author: [Essential Emacs Packages for Efficient Software Development and Text Editing](https://www.jamescherti.com/essential-emacs-packages/) diff --git a/early-init.el b/early-init.el index 9abbfb7..59a86f3 100644 --- a/early-init.el +++ b/early-init.el @@ -150,6 +150,7 @@ pre-early-init.el, and post-early-init.el.") (setq custom-theme-directory (expand-file-name "themes/" minimal-emacs-user-directory)) + (setq custom-file (expand-file-name "custom.el" minimal-emacs-user-directory)) ;;; Garbage collection From b5bea68a67627ed6d2a8658e9dad0965b3c4d0aa Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 23 Jul 2025 19:03:15 -0400 Subject: [PATCH 33/63] Update README.md --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e20c1d5..6ab66b3 100644 --- a/README.md +++ b/README.md @@ -1492,8 +1492,11 @@ In Emacs, customization variables modified via the UI (e.g., `M-x customize`) ar To accomplish this, add the following form to your `~/.emacs.d/post-init.el`: ```elisp -(when (file-exists-p custom-file) - (load custom-file)) +;; In Emacs, customization variables modified via the UI (e.g., M-x customize) +;; are typically stored in a separate file, commonly named 'custom.el'. To +;; ensure these settings are loaded during Emacs initialization, it is necessary +;; to explicitly load this file if it exists. +(load custom-file 'noerror 'no-message) ``` This ensures that any user-defined customizations are applied without interfering with manually maintained configuration files. From 12703b20a039e9f2462d783f6e5ab19fcb61e9d1 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 23 Jul 2025 19:13:13 -0400 Subject: [PATCH 34/63] Update README.md --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6ab66b3..acbd787 100644 --- a/README.md +++ b/README.md @@ -1487,9 +1487,9 @@ fc-list : family | sed 's/,/\n/g' | sort -u ### Loading the custom.el file -In Emacs, customization variables modified via the UI (e.g., `M-x customize`) are typically stored in a separate file, commonly named `custom.el`. To ensure these settings are loaded during Emacs initialization, it is necessary to explicitly load this file if it exists. +**NOTE:** The author advises against loading `custom.el`. To disable it, set `custom-file` to the null device using `(setq custom-file null-device)`. Users are instead encouraged to define their configuration programmatically in files such as `post-init.el`. -To accomplish this, add the following form to your `~/.emacs.d/post-init.el`: +In Emacs, customization variables modified via the UI (e.g., `M-x customize`) are typically stored in a separate file, commonly named `custom.el`. To ensure these settings are loaded during Emacs initialization, it is necessary to explicitly load this file if it exists. To accomplish this, add the following form to your `~/.emacs.d/post-init.el`: ```elisp ;; In Emacs, customization variables modified via the UI (e.g., M-x customize) @@ -1499,8 +1499,6 @@ To accomplish this, add the following form to your `~/.emacs.d/post-init.el`: (load custom-file 'noerror 'no-message) ``` -This ensures that any user-defined customizations are applied without interfering with manually maintained configuration files. - ### Which other customizations can be interesting to add? 1. Read the following article from the same author: [Essential Emacs Packages for Efficient Software Development and Text Editing](https://www.jamescherti.com/essential-emacs-packages/) From d0029622d8a7c2ce27ee925594d74e4216108576 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 23 Jul 2025 19:16:21 -0400 Subject: [PATCH 35/63] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index acbd787..3f16908 100644 --- a/README.md +++ b/README.md @@ -1487,7 +1487,7 @@ fc-list : family | sed 's/,/\n/g' | sort -u ### Loading the custom.el file -**NOTE:** The author advises against loading `custom.el`. To disable it, set `custom-file` to the null device using `(setq custom-file null-device)`. Users are instead encouraged to define their configuration programmatically in files such as `post-init.el`. +**NOTE:** The author advises against loading `custom.el`. To disable it, set `custom-file` to the null device using `(setq custom-file null-device)`. Users are instead encouraged to define their configuration programmatically in files such as `post-init.el`. Maintaining configuration programmatically offers several advantages: it ensures transparency and reproducibility, facilitates version control. Unlike the automatically generated custom.el, which may introduce opaque or redundant settings, programmatic configuration is explicit and deterministic. This makes it easier to understand, audit, and evolve the configuration over time. In Emacs, customization variables modified via the UI (e.g., `M-x customize`) are typically stored in a separate file, commonly named `custom.el`. To ensure these settings are loaded during Emacs initialization, it is necessary to explicitly load this file if it exists. To accomplish this, add the following form to your `~/.emacs.d/post-init.el`: From 7b78ad5fcc0b0ebd58995648104c5a0cb0c7e19b Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 23 Jul 2025 19:17:58 -0400 Subject: [PATCH 36/63] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3f16908..fa82e74 100644 --- a/README.md +++ b/README.md @@ -1487,7 +1487,7 @@ fc-list : family | sed 's/,/\n/g' | sort -u ### Loading the custom.el file -**NOTE:** The author advises against loading `custom.el`. To disable it, set `custom-file` to the null device using `(setq custom-file null-device)`. Users are instead encouraged to define their configuration programmatically in files such as `post-init.el`. Maintaining configuration programmatically offers several advantages: it ensures transparency and reproducibility, facilitates version control. Unlike the automatically generated custom.el, which may introduce opaque or redundant settings, programmatic configuration is explicit and deterministic. This makes it easier to understand, audit, and evolve the configuration over time. +**NOTE:** The author advises against loading `custom.el`. To disable it, set `custom-file` to the null device using `(setq custom-file null-device)`. Users are instead encouraged to define their configuration programmatically in files such as `post-init.el`. Maintaining configuration programmatically offers several advantages: it ensures reproducibility and facilitates version control. This makes it easier to understand, audit, and evolve the configuration over time. In Emacs, customization variables modified via the UI (e.g., `M-x customize`) are typically stored in a separate file, commonly named `custom.el`. To ensure these settings are loaded during Emacs initialization, it is necessary to explicitly load this file if it exists. To accomplish this, add the following form to your `~/.emacs.d/post-init.el`: From 9bf0d83802e646b6bc359cacba092e0ef25d570a Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 25 Jul 2025 12:16:37 -0400 Subject: [PATCH 37/63] Move dired group directories first to the README.md file --- README.md | 10 ++++++++++ early-init.el | 3 --- init.el | 12 ------------ 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index fa82e74..dae894c 100644 --- a/README.md +++ b/README.md @@ -1587,6 +1587,16 @@ In Emacs, customization variables modified via the UI (e.g., `M-x customize`) ar "\\|^flymake_.*")) (add-hook 'dired-mode-hook #'dired-omit-mode) +;; dired: Group directories first +(with-eval-after-load 'dired + (let ((args "--group-directories-first -ahlv")) + (when (or (eq system-type 'darwin) (eq system-type 'berkeley-unix)) + (if-let* ((gls (executable-find "gls"))) + (setq insert-directory-program gls) + (setq args nil))) + (when args + (setq dired-listing-switches args)))) + ;; Enables visual indication of minibuffer recursion depth after initialization. (add-hook 'after-init-hook #'minibuffer-depth-indicate-mode) diff --git a/early-init.el b/early-init.el index 59a86f3..a787ffe 100644 --- a/early-init.el +++ b/early-init.el @@ -96,9 +96,6 @@ modified during setup.") (defvar minimal-emacs-user-directory user-emacs-directory "The default value of the `user-emacs-directory' variable.") -(defvar minimal-emacs-dired-group-directories-first nil - "If non-nil, group directories first in Dired listings.") - ;;; Load pre-early-init.el ;; Prefer loading newer compiled files diff --git a/init.el b/init.el index 6aa3067..5abb833 100644 --- a/init.el +++ b/init.el @@ -416,18 +416,6 @@ (setq dired-omit-verbose nil) (setq dired-omit-files (concat "\\`[.]\\'")) -;; Group directories first -(when minimal-emacs-dired-group-directories-first - (with-eval-after-load 'dired - (let ((args "--group-directories-first -ahlv")) - (when (or (eq system-type 'darwin) - (eq system-type 'berkeley-unix)) - (if-let* ((gls (executable-find "gls"))) - (setq insert-directory-program gls) - (setq args nil))) - (when args - (setq dired-listing-switches args))))) - (setq ls-lisp-verbosity nil) (setq ls-lisp-dirs-first t) From 591edf73144eb7851abdadd99e17db4926f5eafc Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 25 Jul 2025 12:31:33 -0400 Subject: [PATCH 38/63] Move compilation closer to comint --- init.el | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/init.el b/init.el index 5abb833..a9dfc53 100644 --- a/init.el +++ b/init.el @@ -87,12 +87,6 @@ show-paren-when-point-inside-paren t show-paren-when-point-in-periphery t) -;;; Compilation - -(setq compilation-always-kill t - compilation-ask-about-save nil - compilation-scroll-output 'first-error) - ;;; Misc (setq custom-buffer-done-kill t) @@ -147,8 +141,17 @@ (setq uniquify-buffer-name-style 'forward) -(setq comint-prompt-read-only t) -(setq comint-buffer-maximum-size 2048) +;;; comint (general command interpreter in a window) + +(setq ansi-color-for-comint-mode t + comint-prompt-read-only t + comint-buffer-maximum-size 4096) + +;;; Compilation + +(setq compilation-ask-about-save nil + compilation-always-kill t + compilation-scroll-output 'first-error) ;; Skip confirmation prompts when creating a new file or buffer (setq confirm-nonexistent-file-or-buffer nil) @@ -300,7 +303,8 @@ ;; The blinking cursor is distracting and interferes with cursor settings in ;; some minor modes that try to change it buffer-locally (e.g., Treemacs). -(blink-cursor-mode -1) +(when (bound-and-true-p blink-cursor-mode) + (blink-cursor-mode -1)) ;; Don't blink the paren matching the one at point, it's too distracting. (setq blink-matching-paren nil) From 379131cdc23cbdaa3908dce91247ff97e035b430 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 26 Jul 2025 12:44:05 -0400 Subject: [PATCH 39/63] Update recentf config --- README.md | 2 +- init.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dae894c..60d32a9 100644 --- a/README.md +++ b/README.md @@ -301,7 +301,7 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already (add-hook 'after-init-hook #'(lambda() (let ((inhibit-message t)) (recentf-mode 1)))) - +(setq recentf-auto-cleanup (if (daemonp) 300 'never)) (with-eval-after-load "recentf" (add-hook 'kill-emacs-hook #'recentf-cleanup)) diff --git a/init.el b/init.el index a9dfc53..157a62d 100644 --- a/init.el +++ b/init.el @@ -217,7 +217,7 @@ ;; `recentf' is an that maintains a list of recently accessed files. (setq recentf-max-saved-items 300) ; default is 20 (setq recentf-max-menu-items 15) -(setq recentf-auto-cleanup (if (daemonp) 300 'never)) +(setq recentf-auto-cleanup 'mode) ;; Update recentf-exclude (setq recentf-exclude (list "^/\\(?:ssh\\|su\\|sudo\\)?:")) From 848c5a4cd5225466eb9960674f08612dc84fff6f Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 26 Jul 2025 12:48:30 -0400 Subject: [PATCH 40/63] Update recentf config in README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 60d32a9..2092341 100644 --- a/README.md +++ b/README.md @@ -305,6 +305,15 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already (with-eval-after-load "recentf" (add-hook 'kill-emacs-hook #'recentf-cleanup)) +(setq recentf-exclude + (list "\\.tar$" "\\.tbz2$" "\\.tbz$" "\\.tgz$" "\\.bz2$" + "\\.bz$" "\\.gz$" "\\.gzip$" "\\.xz$" "\\.zpaq$" + "\\.lz$" "\\.lrz$" "\\.lzo$" "\\.lzma$" "\\.shar$" + "\\.kgb$" "\\.zip$" "\\.Z$" "\\.7z$" "\\.rar$" + "COMMIT_EDITMSG\\'" + "\\.\\(?:gz\\|gif\\|svg\\|png\\|jpe?g\\|bmp\\|xpm\\)$" + "-autoloads\\.el$" "autoload\\.el$")) + ;; savehist is an Emacs feature that preserves the minibuffer history between ;; sessions. It saves the history of inputs in the minibuffer, such as commands, ;; search strings, and other prompts, to a file. This allows users to retain From a12275b3d2a5d361ae1773954c2a17c9b314c84b Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 26 Jul 2025 13:03:06 -0400 Subject: [PATCH 41/63] Update README.md --- README.md | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 2092341..6ed77c1 100644 --- a/README.md +++ b/README.md @@ -295,24 +295,31 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already ;; on disk. (add-hook 'after-init-hook #'global-auto-revert-mode) -;; recentf is an Emacs package that maintains a list of recently +;; Recentf is an Emacs package that maintains a list of recently ;; accessed files, making it easier to reopen files you have worked on ;; recently. -(add-hook 'after-init-hook #'(lambda() - (let ((inhibit-message t)) - (recentf-mode 1)))) -(setq recentf-auto-cleanup (if (daemonp) 300 'never)) -(with-eval-after-load "recentf" - (add-hook 'kill-emacs-hook #'recentf-cleanup)) +(use-package recentf + :ensure nil + :commands (recentf-mode recentf-cleanup) + :hook + (after-init . recentf-mode) -(setq recentf-exclude - (list "\\.tar$" "\\.tbz2$" "\\.tbz$" "\\.tgz$" "\\.bz2$" - "\\.bz$" "\\.gz$" "\\.gzip$" "\\.xz$" "\\.zpaq$" - "\\.lz$" "\\.lrz$" "\\.lzo$" "\\.lzma$" "\\.shar$" - "\\.kgb$" "\\.zip$" "\\.Z$" "\\.7z$" "\\.rar$" - "COMMIT_EDITMSG\\'" - "\\.\\(?:gz\\|gif\\|svg\\|png\\|jpe?g\\|bmp\\|xpm\\)$" - "-autoloads\\.el$" "autoload\\.el$")) + :custom + (recentf-auto-cleanup (if (daemonp) 300 'never)) + (recentf-exclude + (list "\\.tar$" "\\.tbz2$" "\\.tbz$" "\\.tgz$" "\\.bz2$" + "\\.bz$" "\\.gz$" "\\.gzip$" "\\.xz$" "\\.zip$" + "\\.7z$" "\\.rar$" + "COMMIT_EDITMSG\\'" + "\\.\\(?:gz\\|gif\\|svg\\|png\\|jpe?g\\|bmp\\|xpm\\)$" + "-autoloads\\.el$" "autoload\\.el$")) + + :config + ;; A cleanup depth of -90 ensures that `recentf-cleanup' runs before + ;; `recentf-save-list', allowing stale entries to be removed before the list + ;; is saved by `recentf-save-list', which is automatically added to + ;; `kill-emacs-hook' by `recentf-mode'. + (add-hook 'kill-emacs-hook #'recentf-cleanup -90)) ;; savehist is an Emacs feature that preserves the minibuffer history between ;; sessions. It saves the history of inputs in the minibuffer, such as commands, From fe289b6d45e01e82cd8a5ac3fdbb1c2fd81f7de1 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 26 Jul 2025 13:09:55 -0400 Subject: [PATCH 42/63] Update README.md: autorevert --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ed77c1..48278bb 100644 --- a/README.md +++ b/README.md @@ -293,7 +293,19 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already ;; Auto-revert in Emacs is a feature that automatically updates the ;; contents of a buffer to reflect changes made to the underlying file ;; on disk. -(add-hook 'after-init-hook #'global-auto-revert-mode) +(use-package autorevert + :ensure nil + :commands (auto-revert-mode + auto-revert-handler + global-auto-revert-mode) + :hook + (after-init . global-auto-revert-mode) + :config + (auto-revert-remote-files nil) + (auto-revert-use-notify t) + (auto-revert-avoid-polling nil) + (auto-revert-interval 3) + (auto-revert-verbose t)) ;; Recentf is an Emacs package that maintains a list of recently ;; accessed files, making it easier to reopen files you have worked on From 93548a3784b3acf9419cc2d22d322864104d2bbb Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 26 Jul 2025 13:21:08 -0400 Subject: [PATCH 43/63] Update README.md: saveplace and savehist --- README.md | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 48278bb..b118ce4 100644 --- a/README.md +++ b/README.md @@ -295,16 +295,14 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already ;; on disk. (use-package autorevert :ensure nil - :commands (auto-revert-mode - auto-revert-handler - global-auto-revert-mode) + :commands (auto-revert-mode global-auto-revert-mode) :hook (after-init . global-auto-revert-mode) - :config + :custom + (auto-revert-interval 3) (auto-revert-remote-files nil) (auto-revert-use-notify t) (auto-revert-avoid-polling nil) - (auto-revert-interval 3) (auto-revert-verbose t)) ;; Recentf is an Emacs package that maintains a list of recently @@ -337,12 +335,24 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already ;; sessions. It saves the history of inputs in the minibuffer, such as commands, ;; search strings, and other prompts, to a file. This allows users to retain ;; their minibuffer history across Emacs restarts. -(add-hook 'after-init-hook #'savehist-mode) +(use-package savehist + :ensure nil + :commands (savehist-mode savehist-save) + :hook + (after-init . savehist-mode) + :custom + (savehist-autosave-interval 600)) ;; save-place-mode enables Emacs to remember the last location within a file ;; upon reopening. This feature is particularly beneficial for resuming work at ;; the precise point where you previously left off. -(add-hook 'after-init-hook #'save-place-mode) +(use-package saveplace + :ensure nil + :commands (save-place-mode save-place-local-mode) + :hook + (after-init . save-place-mode) + :custom + (save-place-limit 400)) ``` ### Activating autosave From cbcfdf19a701fccc7717301799aa05455aafc49c Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 26 Jul 2025 15:35:38 -0400 Subject: [PATCH 44/63] Update README.md --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b118ce4..16ad766 100644 --- a/README.md +++ b/README.md @@ -341,7 +341,12 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already :hook (after-init . savehist-mode) :custom - (savehist-autosave-interval 600)) + (savehist-autosave-interval 600) + (savehist-additional-variables + '(kill-ring ; clipboard + register-alist ; macros + mark-ring global-mark-ring ; marks + search-ring regexp-search-ring))) ;; save-place-mode enables Emacs to remember the last location within a file ;; upon reopening. This feature is particularly beneficial for resuming work at From 988a7f6a5160c31df1adc3833af6eb1784b3df9e Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 26 Jul 2025 18:37:17 -0400 Subject: [PATCH 45/63] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 16ad766..575f569 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of * The *minimal-emacs.d* project is: - **Minimal yet effective:** A solid starting point. - **Better defaults:** Improved settings for usability, UI, garbage collection, and built-in packages. -- **0 packages loaded / No forced modes:** Unlike other frameworks or starter kits, *minimal-emacs.d* does not impose modes or require packages. **You have full control** over which global or minor modes to enable and which packages to load with `require`. +- **0 packages loaded / No forced modes:** Unlike other frameworks or starter kits, *minimal-emacs.d* does not impose modes or require packages. **You have full control** over which global or minor modes to enable and which packages to load. - **Customizable foundation:** Designed to be extended, not replaced. This README.md offers extensive recommendations for customizing your *minimal-emacs.d* configuration. (Reminder: [Never modify init.el and early-init.el. Modify these instead...](#customizations-never-modify-initel-and-early-initel-modify-these-instead)) The *minimal-emacs.d* project includes two initialization files: From 1ad3cd6a57e0413a3427aa00becd868eccb1e2bd Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 28 Jul 2025 12:03:16 -0400 Subject: [PATCH 46/63] Update README.md --- README.md | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/README.md b/README.md index 575f569..c3f2fd7 100644 --- a/README.md +++ b/README.md @@ -215,24 +215,6 @@ An alternative lightweight approach is to simply change the default `~/.emacs.d` (setq package-user-dir (expand-file-name "elpa" user-emacs-directory)) ``` -It is also useful to ensure that Emacs consistently utilizes the specified ELN cache directory for native compilation, thereby preventing it from generating or loading .eln files in the default system or user-standard locations. This guarantees that both the loading and writing of native-compiled files occur exclusively within the user-defined cache directory, avoiding permission issues and path inconsistencies. Add the following code to `~/.emacs.d/pre-early-init.el` -``` emacs-lisp -;; NOTE: This must be placed in 'pre-early-init.el'. -(when (featurep 'native-compile) - ;; Ensure Emacs consistently uses the specified ELN cache directory for native - ;; compilation, preventing it from creating or loading .eln files in the - ;; default system or user-standard paths. This guarantees that both loading - ;; and writing of native-compiled files happen exclusively in the user-defined - ;; cache directory, avoiding permission issues and path inconsistencies. - (let ((eln-cache-dir (convert-standard-filename - (expand-file-name "eln-cache" user-emacs-directory)))) - (when (boundp 'native-comp-eln-load-path) - (setcar native-comp-eln-load-path eln-cache-dir)) - (setq native-compile-target-directory eln-cache-dir) - (when (fboundp 'startup-redirect-eln-cache) - (startup-redirect-eln-cache eln-cache-dir)))) -``` - **IMPORTANT:** The code above should be added to `~/.emacs.d/pre-early-init.el`, not the other files, as it modifies the behavior of all subsequent init files. ## Customizations: Packages (post-init.el) From 1f9006bd25519eb86d3b910d2a5379c09a6db769 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 29 Jul 2025 08:46:01 -0400 Subject: [PATCH 47/63] Add dired-movement-style and group dired setq --- init.el | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/init.el b/init.el index 157a62d..7f7fa50 100644 --- a/init.el +++ b/init.el @@ -402,7 +402,11 @@ dired-filter-verbose nil dired-recursive-deletes 'top dired-recursive-copies 'always - dired-create-destination-dirs 'ask) + dired-movement-style 'bounded-files + dired-vc-rename-file t + dired-create-destination-dirs 'ask + ;; Disable the prompt about killing the Dired buffer for a deleted directory. + dired-clean-confirm-killing-deleted-buffers nil) ;; This is a higher-level predicate that wraps `dired-directory-changed-p' ;; with additional logic. This `dired-buffer-stale-p' predicate handles remote @@ -411,14 +415,9 @@ (setq auto-revert-remote-files nil) (setq dired-auto-revert-buffer 'dired-buffer-stale-p) -(setq dired-vc-rename-file t) - -;; Disable the prompt about killing the Dired buffer for a deleted directory. -(setq dired-clean-confirm-killing-deleted-buffers nil) - ;; dired-omit-mode -(setq dired-omit-verbose nil) -(setq dired-omit-files (concat "\\`[.]\\'")) +(setq dired-omit-verbose nil + dired-omit-files (concat "\\`[.]\\'")) (setq ls-lisp-verbosity nil) (setq ls-lisp-dirs-first t) From c9e16103c8515d3c37ad92af012ff8efe933bcee Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 29 Jul 2025 08:47:33 -0400 Subject: [PATCH 48/63] Update comments --- init.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index 7f7fa50..1920ff6 100644 --- a/init.el +++ b/init.el @@ -402,10 +402,11 @@ dired-filter-verbose nil dired-recursive-deletes 'top dired-recursive-copies 'always - dired-movement-style 'bounded-files dired-vc-rename-file t dired-create-destination-dirs 'ask - ;; Disable the prompt about killing the Dired buffer for a deleted directory. + ;; Constrain vertical cursor movement to lines within the buffer + dired-movement-style 'bounded-files + ;; Suppress Dired buffer kill prompt for deleted dirs dired-clean-confirm-killing-deleted-buffers nil) ;; This is a higher-level predicate that wraps `dired-directory-changed-p' From aeb1367ccc34b00e3d8ef992004484921d36227c Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 1 Aug 2025 23:31:58 -0400 Subject: [PATCH 49/63] Move dired-movement-style to README.md --- README.md | 3 +++ init.el | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c3f2fd7..112fe9e 100644 --- a/README.md +++ b/README.md @@ -1594,6 +1594,9 @@ In Emacs, customization variables modified via the UI (e.g., `M-x customize`) ar ;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Window-Dividers.html (add-hook 'after-init-hook #'window-divider-mode) +;; Constrain vertical cursor movement to lines within the buffer +(setq dired-movement-style 'bounded-files) + ;; Dired buffers: Automatically hide file details (permissions, size, ;; modification date, etc.) and all the files in the `dired-omit-files' regular ;; expression for a cleaner display. diff --git a/init.el b/init.el index 1920ff6..e8aaa18 100644 --- a/init.el +++ b/init.el @@ -404,8 +404,6 @@ dired-recursive-copies 'always dired-vc-rename-file t dired-create-destination-dirs 'ask - ;; Constrain vertical cursor movement to lines within the buffer - dired-movement-style 'bounded-files ;; Suppress Dired buffer kill prompt for deleted dirs dired-clean-confirm-killing-deleted-buffers nil) From cdeaf6b3d60a1cccff601585e004f2ba221cfde2 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Thu, 7 Aug 2025 10:30:29 -0400 Subject: [PATCH 50/63] Add dired-mouse-drag-files --- init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/init.el b/init.el index e8aaa18..c666ed7 100644 --- a/init.el +++ b/init.el @@ -404,6 +404,7 @@ dired-recursive-copies 'always dired-vc-rename-file t dired-create-destination-dirs 'ask + dired-mouse-drag-files t ;; Suppress Dired buffer kill prompt for deleted dirs dired-clean-confirm-killing-deleted-buffers nil) From 4693b48aeb10c161bff1420de31226dc9f7836e3 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Thu, 7 Aug 2025 12:40:49 -0400 Subject: [PATCH 51/63] Remove warning for set-goal-column --- init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.el b/init.el index c666ed7..74ff814 100644 --- a/init.el +++ b/init.el @@ -542,7 +542,7 @@ (dolist (cmd '(list-timers narrow-to-region upcase-region downcase-region list-threads erase-buffer scroll-left - dired-find-alternate-file)) + dired-find-alternate-file set-goal-column)) (put cmd 'disabled nil)) ;;; Load post init From 096d4ab49d1fefcbb230483f66d7e348df5767c5 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 8 Aug 2025 16:22:14 -0400 Subject: [PATCH 52/63] Update README.md --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 112fe9e..15b4d0f 100644 --- a/README.md +++ b/README.md @@ -1290,6 +1290,13 @@ To configure **flyspell**, add the following to `~/.emacs.d/post-init.el`: ;; Set the ispell program name to aspell (ispell-program-name "aspell") + ;; Define the "en_US" spell-check dictionary locally, telling Emacs to use + ;; UTF-8 encoding, match words using alphabetic characters, allow apostrophes + ;; inside words, treat non-alphabetic characters as word boundaries, and pass + ;; -d en_US to the underlying spell-check program. + (setq ispell-local-dictionary-alist + '(("en_US" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-d" "en_US") nil utf-8))) + ;; Configures Aspell's suggestion mode to "ultra", which provides more ;; aggressive and detailed suggestions for misspelled words. The language ;; is set to "en_US" for US English, which can be replaced with your desired @@ -1303,7 +1310,7 @@ To configure **flyspell**, add the following to `~/.emacs.d/post-init.el`: :ensure nil :commands flyspell-mode :hook - ((prog-mode . flyspell-prog-mode) + (; (prog-mode . flyspell-prog-mode) (text-mode . (lambda() (if (or (derived-mode-p 'yaml-mode) (derived-mode-p 'yaml-ts-mode) From bea24ca3c26e7dea8cda23d97d215e9b885c3129 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 8 Aug 2025 16:54:38 -0400 Subject: [PATCH 53/63] Update README.md --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 15b4d0f..b75d5d3 100644 --- a/README.md +++ b/README.md @@ -1281,6 +1281,8 @@ NOTE: `inhibit-mouse-mode` allows users to disable and re-enable mouse functiona The `flyspell` package is a built-in Emacs minor mode that provides on-the-fly spell checking. It highlights misspelled words as you type, offering interactive corrections. In text modes, it checks the entire buffer, while in programming modes, it typically checks only comments and strings. It integrates with external spell checkers like `aspell`, `hunspell`, or `ispell` to provide suggestions and corrections. +NOTE: `flyspell-mode` can become slow when using Aspell, especially with large buffers or aggressive suggestion settings like `--sug-mode=ultra`. This slowdown occurs because Flyspell checks words dynamically as you type or navigate text, requiring frequent communication between Emacs and the external Aspell process. Each check involves sending words to Aspell and receiving results, which introduces overhead from process invocation and inter-process communication. + To configure **flyspell**, add the following to `~/.emacs.d/post-init.el`: ``` emacs-lisp (use-package ispell @@ -1294,14 +1296,15 @@ To configure **flyspell**, add the following to `~/.emacs.d/post-init.el`: ;; UTF-8 encoding, match words using alphabetic characters, allow apostrophes ;; inside words, treat non-alphabetic characters as word boundaries, and pass ;; -d en_US to the underlying spell-check program. - (setq ispell-local-dictionary-alist - '(("en_US" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-d" "en_US") nil utf-8))) + (ispell-local-dictionary-alist + '(("en_US" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-d" "en_US") nil utf-8))) ;; Configures Aspell's suggestion mode to "ultra", which provides more ;; aggressive and detailed suggestions for misspelled words. The language ;; is set to "en_US" for US English, which can be replaced with your desired ;; language code (e.g., "en_GB" for British English, "de_DE" for German). - (ispell-extra-args '("--sug-mode=ultra" "--lang=en_US"))) + (ispell-extra-args '(; "--sug-mode=ultra" + "--lang=en_US"))) ;; The flyspell package is a built-in Emacs minor mode that provides ;; on-the-fly spell checking. It highlights misspelled words as you type, @@ -1315,7 +1318,7 @@ To configure **flyspell**, add the following to `~/.emacs.d/post-init.el`: (if (or (derived-mode-p 'yaml-mode) (derived-mode-p 'yaml-ts-mode) (derived-mode-p 'ansible-mode)) - (flyspell-prog-mode) + (flyspell-prog-mode 1) (flyspell-mode 1))))) :config ;; Remove strings from Flyspell From d55daca02033bab4d8701455af7f8b413fb51e0c Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:08:10 -0400 Subject: [PATCH 54/63] Update docstring --- early-init.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/early-init.el b/early-init.el index a787ffe..730122f 100644 --- a/early-init.el +++ b/early-init.el @@ -94,7 +94,8 @@ If nil, these variables are left at their default values and are not modified during setup.") (defvar minimal-emacs-user-directory user-emacs-directory - "The default value of the `user-emacs-directory' variable.") + "Directory beneath minimal-emacs.d files are placed. +Note that this should end with a directory separator.") ;;; Load pre-early-init.el From c6f0cda3186a78065c1ffc212d535a621c0382fe Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:15:46 -0400 Subject: [PATCH 55/63] Update vars order --- early-init.el | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/early-init.el b/early-init.el index 730122f..0d70345 100644 --- a/early-init.el +++ b/early-init.el @@ -58,16 +58,6 @@ Ignored if `minimal-emacs-optimize-startup-gc' is nil.") (defvar minimal-emacs-gc-cons-threshold-restore-delay nil "Number of seconds to wait before restoring `gc-cons-threshold'.") -(defvar minimal-emacs-inhibit-redisplay-during-startup nil - "Suppress redisplay during startup to improve performance. -This prevents visual updates while Emacs initializes. The tradeoff is that you -won't see the progress or activities during the startup process.") - -(defvar minimal-emacs-inhibit-message-during-startup nil - "Suppress startup messages for a cleaner experience. -This slightly enhances performance. The tradeoff is that you won't be informed -of the progress or any relevant activities during startup.") - (defvar minimal-emacs-optimize-file-name-handler-alist t "Enable optimization of `file-name-handler-alist'. When non-nil, this variable activates optimizations to reduce file name handler @@ -93,6 +83,16 @@ native compilation features: If nil, these variables are left at their default values and are not modified during setup.") +(defvar minimal-emacs-inhibit-redisplay-during-startup nil + "Suppress redisplay during startup to improve performance. +This prevents visual updates while Emacs initializes. The tradeoff is that you +won't see the progress or activities during the startup process.") + +(defvar minimal-emacs-inhibit-message-during-startup nil + "Suppress startup messages for a cleaner experience. +This slightly enhances performance. The tradeoff is that you won't be informed +of the progress or any relevant activities during startup.") + (defvar minimal-emacs-user-directory user-emacs-directory "Directory beneath minimal-emacs.d files are placed. Note that this should end with a directory separator.") From 1289ad2c77060f361ae7fa506162061a664f906c Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 12 Aug 2025 14:32:28 -0400 Subject: [PATCH 56/63] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b75d5d3..ae3e157 100644 --- a/README.md +++ b/README.md @@ -383,7 +383,7 @@ This is different from `auto-save-mode`: `auto-save-mode` periodically saves all [Corfu](https://github.com/minad/corfu) enhances in-buffer completion by displaying a compact popup with current candidates, positioned either below or above the point. Candidates can be selected by navigating up or down. -Cape, or Completion At Point Extensions, extends the capabilities of in-buffer completion. It integrates with Corfu or the default completion UI, by providing additional backends through completion-at-point-functions. +[Cape](https://github.com/minad/cape), or Completion At Point Extensions, extends the capabilities of in-buffer completion. It integrates with Corfu or the default completion UI, by providing additional backends through completion-at-point-functions. ![](https://github.com/minad/corfu/blob/screenshots/popupinfo-dark.png?raw=true) From c1338de74c20fd3c408424437d81583840d3cbe9 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 12 Aug 2025 15:05:27 -0400 Subject: [PATCH 57/63] Add persist text scale --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index ae3e157..6f9b6ac 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's - [Enhancing the Elisp development experience](#enhancing-the-elisp-development-experience) - [Showing the tab-bar](#showing-the-tab-bar) - [Changing the Default Font](#changing-the-default-font) + - [Persist Text Scale](#persist-text-scale) - [Loading the custom.el file](#loading-the-customel-file) - [Which other customizations can be interesting to add?](#which-other-customizations-can-be-interesting-to-add) - [Customizations: pre-early-init.el](#customizations-pre-early-initel) @@ -1520,6 +1521,28 @@ On Linux, you can display a comprehensive list of all installed font families by fc-list : family | sed 's/,/\n/g' | sort -u ``` +### Persist Text Scale + +The [persist-text-scale](https://github.com/jamescherti/persist-text-scale.el) Emacs package provides `persist-text-scale-mode`, which ensures that all adjustments made with `text-scale-increase` and `text-scale-decrease` are persisted and restored across sessions. As a result, the text size in each buffer remains consistent, even after restarting Emacs. + +This package also facilitates grouping buffers into categories, allowing buffers within the same category to share a consistent text scale. This ensures uniform font sizes when adjusting text scaling. By default: +- Each file-visiting buffer has its own independent text scale. +- Special buffers, identified by their buffer names, each retain their own text scale setting. +- All Dired buffers maintain the same font size, treating Dired as a unified "file explorer" where the text scale remains consistent across different buffers. + +This category-based behavior can be further customized by assigning a function to the `persist-text-scale-buffer-category-function` variable. The function determines how buffers are categorized by returning a category identifier (string) based on the buffer's context. Buffers within the same category will share the same text scale. + +```elisp +(use-package persist-text-scale + :commands (persist-text-scale-mode + persist-text-scale-restore) + + :hook (after-init . persist-text-scale-mode) + + :custom + (text-scale-mode-step 1.07)) +``` + ### Loading the custom.el file **NOTE:** The author advises against loading `custom.el`. To disable it, set `custom-file` to the null device using `(setq custom-file null-device)`. Users are instead encouraged to define their configuration programmatically in files such as `post-init.el`. Maintaining configuration programmatically offers several advantages: it ensures reproducibility and facilitates version control. This makes it easier to understand, audit, and evolve the configuration over time. From 8966b7ca4d2645000e0863952af508be4c3bfb8a Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 12 Aug 2025 15:06:09 -0400 Subject: [PATCH 58/63] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6f9b6ac..922c69f 100644 --- a/README.md +++ b/README.md @@ -1532,6 +1532,7 @@ This package also facilitates grouping buffers into categories, allowing buffers This category-based behavior can be further customized by assigning a function to the `persist-text-scale-buffer-category-function` variable. The function determines how buffers are categorized by returning a category identifier (string) based on the buffer's context. Buffers within the same category will share the same text scale. +To configure the *persist-text-scale* package, add the following to your `~/.emacs.d/post-init.el`: ```elisp (use-package persist-text-scale :commands (persist-text-scale-mode From 4fb63eee908bb89486de193a092e96d8fe00fe2c Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 13 Aug 2025 22:19:56 -0400 Subject: [PATCH 59/63] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 922c69f..59f286b 100644 --- a/README.md +++ b/README.md @@ -1977,6 +1977,7 @@ A drawback of using the early-init phase instead of init is that if a package fa ### Comments from users - [JamesBrickley (Shout out to this starter-kit: Minimal-Emacs )](https://www.reddit.com/r/emacs/comments/1epz7qn/shout_out_to_this_starterkit_minimalemacs/) appreciates that *minimal-emacs.d* provides an optimized *early-init.el* and *init.el* for fast startup times and sensible default settings. He highlights that the project includes all the essential configurations needed for a well-tuned Emacs setup, eliminating the need to sift through conflicting advice on topics like garbage collection optimization. While he has encountered similar settings before, he also discovered new optimizations he had not seen elsewhere. +- [Brandon Schneider (skarekrow)](https://github.com/skarekrow): "...the minimal-emacs project is incredible. I love how documented it is as a beginner to learn from. Thank you for all the effort you've put into that and the other packages you maintain. It's a huge boon to new users." - [Leading_Ad6415 commented on Reddit](https://www.reddit.com/r/emacs/comments/1feaf37/comment/lmw7ijd/) that after switching to *minimal-emacs.d*, their configuration execution time decreased from 3 seconds to just 1 second by simply replacing their `init.el` and `early-init.el` files with those from the project. - [Another user commented on Reddit](https://www.reddit.com/r/emacs/comments/1feaf37/comment/lrsfd64/), highlighting how a minimal-emacs.d significantly enhanced their Emacs performance. They reported substantial startup time reductions on both their main machine (from ~2.25 to ~0.95 seconds) and an older laptop (from ~2.95 to ~1.27 seconds) while also experiencing a generally snappier performance within Emacs. The user expressed gratitude for the project, calling it fantastic. - [Cyneox commented on Reddit](https://www.reddit.com/r/emacs/comments/1gh687a/comment/lwdv18t/), expressing gratitude for the resource and sharing their experience. They mentioned it was their fourth attempt to set up a vanilla configuration and highlighted that they had been using the repository as a foundation for their customizations over the past few days. They appreciated the absence of unexplained behavior and the clear instructions on where to place files. The user reported successful testing on both Linux and macOS, noting that everything functioned smoothly, including in the terminal. From 2c16d2da10a6f748b1f74e60cbb981f5772321be Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Thu, 14 Aug 2025 17:23:29 -0400 Subject: [PATCH 60/63] Remove dired-mouse-drag-files --- init.el | 1 - 1 file changed, 1 deletion(-) diff --git a/init.el b/init.el index 74ff814..90d822a 100644 --- a/init.el +++ b/init.el @@ -404,7 +404,6 @@ dired-recursive-copies 'always dired-vc-rename-file t dired-create-destination-dirs 'ask - dired-mouse-drag-files t ;; Suppress Dired buffer kill prompt for deleted dirs dired-clean-confirm-killing-deleted-buffers nil) From 31e4eda22b98bd685bf47aed92c732af66a5cd7b Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 15 Aug 2025 11:51:47 -0400 Subject: [PATCH 61/63] Update README.md --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 59f286b..8fba03b 100644 --- a/README.md +++ b/README.md @@ -232,7 +232,7 @@ Native compilation enhances Emacs performance by converting Elisp code into nati ``` (A non-nil result indicates that native compilation is active.) -2. Ensure all libraries are byte-compiled and native-compiled using [compile-angel.el](https://github.com/jamescherti/compile-angel.el). To install compile-angel, add the following code at the very beginning of your `~/.emacs.d/post-init.el` file, before all other packages: +2. Ensure all libraries are byte-compiled and native-compiled using [compile-angel.el](https://github.com/jamescherti/compile-angel.el). To install compile-angel, add the following code to the `~/.emacs.d/post-init.el` file: ```emacs-lisp ;; Native compilation enhances Emacs performance by converting Elisp code into ;; native machine code, resulting in faster execution and improved @@ -242,7 +242,6 @@ Native compilation enhances Emacs performance by converting Elisp code into nati ;; of your `~/.emacs.d/post-init.el` file, before all other packages. (use-package compile-angel :ensure t - :demand t :custom ;; Set `compile-angel-verbose` to nil to suppress output from compile-angel. ;; Drawback: The minibuffer will not display compile-angel's actions. @@ -265,7 +264,9 @@ Native compilation enhances Emacs performance by converting Elisp code into nati ;; A local mode that compiles .el files whenever the user saves them. ;; (add-hook 'emacs-lisp-mode-hook #'compile-angel-on-save-local-mode) - ;; A global mode that compiles .el files before they are loaded. + ;; A global mode that compiles .el files prior to loading them via `load' or + ;; `require'. Additionally, it compiles all packages that were loaded before + ;; the mode `compile-angel-on-load-mode' was activated. (compile-angel-on-load-mode)) ``` From 9eade3da59042fcda88c33f0ccfe76a6f7dc82f6 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 15 Aug 2025 12:19:03 -0400 Subject: [PATCH 62/63] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8fba03b..40be20b 100644 --- a/README.md +++ b/README.md @@ -267,7 +267,7 @@ Native compilation enhances Emacs performance by converting Elisp code into nati ;; A global mode that compiles .el files prior to loading them via `load' or ;; `require'. Additionally, it compiles all packages that were loaded before ;; the mode `compile-angel-on-load-mode' was activated. - (compile-angel-on-load-mode)) + (compile-angel-on-load-mode 1)) ``` ### How to activate recentf, savehist, saveplace, and auto-revert? From 37e2bd448f952e6af0a0bcdb4cacec258a702a31 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 16 Aug 2025 20:13:20 -0400 Subject: [PATCH 63/63] Remove native-comp-async-report-warnings-errors --- early-init.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/early-init.el b/early-init.el index 0d70345..d959cd6 100644 --- a/early-init.el +++ b/early-init.el @@ -189,8 +189,7 @@ pre-early-init.el, and post-early-init.el.") (setq features (delq 'native-compile features))) (setq native-comp-warning-on-missing-source minimal-emacs-debug - native-comp-async-report-warnings-errors (or minimal-emacs-debug 'silent) - native-comp-verbose (if minimal-emacs-debug 1 0)) + native-comp-async-report-warnings-errors (or minimal-emacs-debug 'silent)) (setq jka-compr-verbose minimal-emacs-debug) (setq byte-compile-warnings minimal-emacs-debug