From 2a6fb7ae8db1cc833249ba70e76a7a1eca046bdc Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Thu, 29 Jan 2026 14:43:22 -0500 Subject: [PATCH 001/113] Update README.md --- README.md | 140 +++++++++++++++++++++++++++--------------------------- 1 file changed, 71 insertions(+), 69 deletions(-) diff --git a/README.md b/README.md index 44ad4f3..e59b62b 100644 --- a/README.md +++ b/README.md @@ -74,75 +74,75 @@ Please share your configuration. It could serve as inspiration for other users. ## Table of Contents - [*minimal-emacs.d* - A Customizable Emacs `init.el` and `early-init.el` that Provides Better Defaults and Faster Startup](#minimal-emacsd---a-customizable-emacs-initel-and-early-initel-that-provides-better-defaults-and-faster-startup) - - [Introduction](#introduction) - - [Looking for the ideal starter kit to customize Emacs? You have found it.](#looking-for-the-ideal-starter-kit-to-customize-emacs-you-have-found-it) - - [Startup](#startup) - - [Comments from minimal-emacs.d users](#comments-from-minimal-emacsd-users) - - [Install minimal-emacs.d](#install-minimal-emacsd) - - [Install minimal-emacs.d into `~/.emacs.d`](#install-minimal-emacsd-into-emacsd) - - [Alternative: Install minimal-emacs.d into `~/.minimal-emacs.d`](#alternative-install-minimal-emacsd-into-minimal-emacsd) - - [Update minimal-emacs.d](#update-minimal-emacsd) - - [Customizations: Never modify init.el and early-init.el. Modify these instead...](#customizations-never-modify-initel-and-early-initel-modify-these-instead) - - [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) - - [Activating autosave](#activating-autosave) - - [auto-save-mode (Prevent data loss in case of crashes)](#auto-save-mode-prevent-data-loss-in-case-of-crashes) - - [auto-save-visited-mode (Save file buffers after a few seconds of inactivity)](#auto-save-visited-mode-save-file-buffers-after-a-few-seconds-of-inactivity) - - [Code completion with corfu](#code-completion-with-corfu) - - [Configuring Vertico, Consult, and Embark](#configuring-vertico-consult-and-embark) - - [Code folding](#code-folding) - - [Changing the default theme](#changing-the-default-theme) - - [Automatic removal of trailing whitespace on save](#automatic-removal-of-trailing-whitespace-on-save) - - [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) - - [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) - - [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) - - [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) - - [Configuring straight.el](#configuring-straightel) - - [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) - - [How to get the latest version of all packages? (unstable)](#how-to-get-the-latest-version-of-all-packages-unstable) - - [How to use MELPA stable?](#how-to-use-melpa-stable) - - [How to load a local lisp file for machine-specific configurations?](#how-to-load-a-local-lisp-file-for-machine-specific-configurations) - - [How to prevent Emacs from repeatedly performing native compilation on specific Elisp files](#how-to-prevent-emacs-from-repeatedly-performing-native-compilation-on-specific-elisp-files) - - [How to load Emacs customizations?](#how-to-load-emacs-customizations) - - [How to increase gc-cons-threshold?](#how-to-increase-gc-cons-threshold) - - [How to prevent Emacs from loading .dir-locals.el files?](#how-to-prevent-emacs-from-loading-dir-localsel-files) - - [How to make minimal-emacs.d use an environment variable to change ~/.emacs.d to another directory?](#how-to-make-minimal-emacsd-use-an-environment-variable-to-change-emacsd-to-another-directory) - - [Are post-early-init.el and pre-init.el the same file in terms of the logic?](#are-post-early-initel-and-pre-initel-the-same-file-in-terms-of-the-logic) - - [Why is the menu bar disabled by default?](#why-is-the-menu-bar-disabled-by-default) - - [Why did the author develop minimal-emacs.d?](#why-did-the-author-develop-minimal-emacsd) - - [How to keep minimal-emacs.d pre-\*.el and post-\*.el files in a separate directory?](#how-to-keep-minimal-emacsd-pre-el-and-post-el-files-in-a-separate-directory) - - [How to make *minimal-emacs.d* install packages in the early-init phase instead of the init phase?](#how-to-make-minimal-emacsd-install-packages-in-the-early-init-phase-instead-of-the-init-phase) - - [Minimal-emacs.d configurations from users](#minimal-emacsd-configurations-from-users) - - [Features](#features) - - [Author and license](#author-and-license) - - [Links](#links) + - [Introduction](#introduction) + - [Looking for the ideal starter kit to customize Emacs? You have found it.](#looking-for-the-ideal-starter-kit-to-customize-emacs-you-have-found-it) + - [Startup](#startup) + - [Comments from minimal-emacs.d users](#comments-from-minimal-emacsd-users) + - [Install minimal-emacs.d](#install-minimal-emacsd) + - [Install minimal-emacs.d into `~/.emacs.d`](#install-minimal-emacsd-into-emacsd) + - [Alternative: Install minimal-emacs.d into `~/.minimal-emacs.d`](#alternative-install-minimal-emacsd-into-minimal-emacsd) + - [Update minimal-emacs.d](#update-minimal-emacsd) + - [Customizations: Never modify init.el and early-init.el. Modify these instead...](#customizations-never-modify-initel-and-early-initel-modify-these-instead) + - [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) + - [Activating autosave](#activating-autosave) + - [auto-save-mode (Prevent data loss in case of crashes)](#auto-save-mode-prevent-data-loss-in-case-of-crashes) + - [auto-save-visited-mode (Save file buffers after a few seconds of inactivity)](#auto-save-visited-mode-save-file-buffers-after-a-few-seconds-of-inactivity) + - [Code completion with corfu](#code-completion-with-corfu) + - [Configuring Vertico, Consult, and Embark](#configuring-vertico-consult-and-embark) + - [Code folding](#code-folding) + - [Changing the default theme](#changing-the-default-theme) + - [Automatic removal of trailing whitespace on save](#automatic-removal-of-trailing-whitespace-on-save) + - [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) + - [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) + - [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) + - [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) + - [Configuring straight.el](#configuring-straightel) + - [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) + - [How to get the latest version of all packages? (unstable)](#how-to-get-the-latest-version-of-all-packages-unstable) + - [How to use MELPA stable?](#how-to-use-melpa-stable) + - [How to load a local lisp file for machine-specific configurations?](#how-to-load-a-local-lisp-file-for-machine-specific-configurations) + - [How to prevent Emacs from repeatedly performing native compilation on specific Elisp files](#how-to-prevent-emacs-from-repeatedly-performing-native-compilation-on-specific-elisp-files) + - [How to load Emacs customizations?](#how-to-load-emacs-customizations) + - [How to increase gc-cons-threshold?](#how-to-increase-gc-cons-threshold) + - [How to prevent Emacs from loading .dir-locals.el files?](#how-to-prevent-emacs-from-loading-dir-localsel-files) + - [How to make minimal-emacs.d use an environment variable to change ~/.emacs.d to another directory?](#how-to-make-minimal-emacsd-use-an-environment-variable-to-change-emacsd-to-another-directory) + - [Are post-early-init.el and pre-init.el the same file in terms of the logic?](#are-post-early-initel-and-pre-initel-the-same-file-in-terms-of-the-logic) + - [Why is the menu bar disabled by default?](#why-is-the-menu-bar-disabled-by-default) + - [Why did the author develop minimal-emacs.d?](#why-did-the-author-develop-minimal-emacsd) + - [How to keep minimal-emacs.d pre-\*.el and post-\*.el files in a separate directory?](#how-to-keep-minimal-emacsd-pre-el-and-post-el-files-in-a-separate-directory) + - [How to make *minimal-emacs.d* install packages in the early-init phase instead of the init phase?](#how-to-make-minimal-emacsd-install-packages-in-the-early-init-phase-instead-of-the-init-phase) + - [Minimal-emacs.d configurations from users](#minimal-emacsd-configurations-from-users) + - [Features](#features) + - [Author and license](#author-and-license) + - [Links](#links) @@ -2170,6 +2170,8 @@ A drawback of using the early-init phase instead of init is that if a package fa - [Mark Norton's minimal-emacs.d configuration](https://github.com/Remillard/minimal-emacs.d/tree/develop) +- [ghostlou1043's emacs.d](https://github.com/ghostlou1043/emacs) + - [smahm006 minimal-emacs.d configuration](https://github.com/smahm006/minimal-emacs.d) - [zendo: Emacs literate configuration](https://github.com/zendo/nsworld/blob/main/dotfiles/org/all-emacs.org) From 3827475b536bbf8748f50e041e2360d96b99bbb7 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 31 Jan 2026 16:04:07 -0500 Subject: [PATCH 002/113] Update README.md --- README.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e59b62b..1871886 100644 --- a/README.md +++ b/README.md @@ -969,11 +969,13 @@ To configure **easysession**, add the following to `~/.emacs.d/post-init.el`: (easysession-save-interval (* 10 60)) ; Save every 10 minutes :init - ;; Key mappings: - ;; C-c l for switching sessions - ;; and C-c s for saving the current session - (global-set-key (kbd "C-c l") 'easysession-switch-to) - (global-set-key (kbd "C-c s") 'easysession-save-as) + ;; Key mappings + (global-set-key (kbd "C-c ss") #'easysession-save) + (global-set-key (kbd "C-c sl") #'easysession-switch-to) + (global-set-key (kbd "C-c sL") #'easysession-switch-to-and-restore-geometry) + (global-set-key (kbd "C-c sr") #'easysession-rename) + (global-set-key (kbd "C-c sR") #'easysession-reset) + (global-set-key (kbd "C-c sd") #'easysession-delete) ;; The depth 102 and 103 have been added to to `add-hook' to ensure that the ;; session is loaded after all other packages. (Using 103/102 is particularly @@ -1011,6 +1013,13 @@ To configure **org-mode**, add the following to `~/.emacs.d/post-init.el`: (org-startup-truncated t)) ``` +The `org-appear` package temporarily reveals normally hidden elements (such as emphasis markers, links, or entities) when the cursor enters them, and hides them again when the cursor leaves. To configure **org-appear**, add the following to `~/.emacs.d/post-init.el`: +```elisp +(use-package org-appear + :commands org-appear-mode + :hook (org-mode . org-appear-mode)) +``` + ### Configuring markdown-mode (e.g., README.md syntax) The [markdown-mode](https://github.com/jrblevin/markdown-mode) package provides a major mode for Emacs for syntax highlighting, editing commands, and preview support for Markdown documents. It supports core Markdown syntax as well as extensions like GitHub Flavored Markdown (GFM). From 22efd9d88f74daae5ba9fc00fcdb5363d83bc283 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 31 Jan 2026 16:13:06 -0500 Subject: [PATCH 003/113] Update README.md --- README.md | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1871886..933f158 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,8 @@ Please share your configuration. It could serve as inspiration for other users. - [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) + - [Highlighting uncommitted changes in the buffer margin (e.g., Git changes)](#highlighting-uncommitted-changes-in-the-buffer-margin-eg-git-changes) + - [Persisting Text Scale](#persisting-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) @@ -1573,7 +1574,24 @@ 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 +### Highlighting uncommitted changes in the buffer margin (e.g., Git changes) + +The [diff-hl](https://github.com/dgutov/diff-hl) package highlights uncommitted changes in the window margin, enabling navigation between them. Also known as source control gutter indicators, it displays added, modified, and deleted lines in real time. In Git-controlled buffers, changes can be staged and unstaged directly, providing a clear view of version-control changes without running `git diff`. By default, the module does not start `diff-hl-mode` automatically. + +To configure the *diff-hl* package, add the following to your `~/.emacs.d/post-init.el`: +```elisp +(use-package diff-hl + :commands (diff-hl-mode + global-diff-hl-mode) + :hook (prog-mode . diff-hl-mode) + :init + (setq diff-hl-flydiff-delay 0.4) ; Faster + (setq diff-hl-show-staged-changes nil) ; Realtime feedback + (setq diff-hl-update-async t) ; Do not block Emacs + (setq diff-hl-global-modes '(not pdf-view-mode image-mode))) +``` + +### Persisting 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. @@ -1665,6 +1683,21 @@ In Emacs, customization variables modified via the UI (e.g., `M-x customize`) ar ;; Track changes in the window configuration, allowing undoing actions such as ;; closing windows. +(setq winner-boring-buffers '("*Completions*" + "*Minibuf-0*" + "*Minibuf-1*" + "*Minibuf-2*" + "*Minibuf-3*" + "*Minibuf-4*" + "*Compile-Log*" + "*inferior-lisp*" + "*Fuzzy Completions*" + "*Apropos*" + "*Help*" + "*cvs*" + "*Buffer List*" + "*Ibuffer*" + "*esh command on file*")) (add-hook 'after-init-hook #'winner-mode) (use-package uniquify From 6326144ab954a2ff178b1a8acf723317834eda51 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 31 Jan 2026 16:15:19 -0500 Subject: [PATCH 004/113] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 933f158..f08ae29 100644 --- a/README.md +++ b/README.md @@ -1578,6 +1578,8 @@ fc-list : family | sed 's/,/\n/g' | sort -u The [diff-hl](https://github.com/dgutov/diff-hl) package highlights uncommitted changes in the window margin, enabling navigation between them. Also known as source control gutter indicators, it displays added, modified, and deleted lines in real time. In Git-controlled buffers, changes can be staged and unstaged directly, providing a clear view of version-control changes without running `git diff`. By default, the module does not start `diff-hl-mode` automatically. +![](https://raw.githubusercontent.com/dgutov/diff-hl/refs/heads/master/screenshot.png) + To configure the *diff-hl* package, add the following to your `~/.emacs.d/post-init.el`: ```elisp (use-package diff-hl From fb944b6e849985dbb4d74d5e4918d3c161635bb8 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 31 Jan 2026 16:29:14 -0500 Subject: [PATCH 005/113] Remove right/left-fringe-width and update comments --- init.el | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/init.el b/init.el index 90a9b13..2012633 100644 --- a/init.el +++ b/init.el @@ -49,19 +49,15 @@ (when (bound-and-true-p minimal-emacs-package-initialize-and-refresh) ;; Initialize and refresh package contents again if needed (package-initialize) - ;; Install use-package if necessary (unless (package-installed-p 'use-package) (unless (seq-empty-p package-archive-contents) (package-refresh-contents)) (package-install 'use-package)) - - ;; Ensure use-package is available (require 'use-package)) ;;; Minibuffer -;; Allow nested minibuffers -(setq enable-recursive-minibuffers t) +(setq enable-recursive-minibuffers t) ; Allow nested minibuffers ;; Keep the cursor out of the read-only portions of the.minibuffer (setq minibuffer-prompt-properties @@ -122,7 +118,7 @@ ;; Benefit: you never lose bookmarks if Emacs crashes. (setq bookmark-save-flag 1) -;;; tramp +;;; Tramp (setq tramp-verbose 1) (setq tramp-completion-reread-directory-timeout 50) @@ -332,9 +328,6 @@ ;; deletion, disrupting the flow of editing. (setq delete-pair-blink-delay 0.03) -(setq-default left-fringe-width 8) -(setq-default right-fringe-width 8) - ;; Disable visual indicators in the fringe for buffer boundaries and empty lines (setq-default indicate-buffer-boundaries nil) (setq-default indicate-empty-lines nil) @@ -390,8 +383,7 @@ ;;; Modeline -;; Makes Emacs omit the load average information from the mode line. -(setq display-time-default-load-average nil) +(setq display-time-default-load-average nil) ; Omit load average ;;; Filetype @@ -448,13 +440,14 @@ ;;; Eglot +(setq eglot-report-progress minimal-emacs-debug) ; Prevent minibuffer spam +(setq eglot-autoshutdown t) ; Shut down after killing last managed buffer + ;; A setting of nil or 0 means Eglot will not block the UI at all, allowing ;; Emacs to remain fully responsive, although LSP features will only become ;; available once the connection is established in the background. (setq eglot-sync-connect 0) -(setq eglot-autoshutdown t) ; Shut down server after killing last managed buffer - ;; Activate Eglot in cross-referenced non-project files (setq eglot-extend-to-xref t) @@ -467,19 +460,14 @@ (setq eglot-events-buffer-size 0) ; Deprecated (setq eglot-events-buffer-config '(:size 0 :format short))) -(setq eglot-report-progress minimal-emacs-debug) ; Prevent minibuffer spam - ;;; Flymake (setq flymake-show-diagnostics-at-end-of-line nil) - -;; Disable wrapping around when navigating Flymake errors. (setq flymake-wrap-around nil) ;;; hl-line-mode -;; Restrict `hl-line-mode' highlighting to the current window, reducing visual -;; clutter and slightly improving `hl-line-mode' performance. +;; Highlighting the current window, reducing clutter and improving performance (setq hl-line-sticky-flag nil) (setq global-hl-line-sticky-flag nil) @@ -491,11 +479,10 @@ ;;; flyspell -(setq flyspell-issue-welcome-flag nil) - ;; Improves flyspell performance by preventing messages from being displayed for ;; each word when checking the entire buffer. (setq flyspell-issue-message-flag nil) +(setq flyspell-issue-welcome-flag nil) ;;; ispell @@ -522,8 +509,8 @@ ;;; abbrev -;; Ensure `abbrev_defs` is stored in the correct location when -;; `user-emacs-directory` is modified, as it defaults to ~/.emacs.d/abbrev_defs +;; Ensure the abbrev_defs file is stored in the correct location when +;; `user-emacs-directory' is modified, as it defaults to ~/.emacs.d/abbrev_defs ;; regardless of the change. (setq abbrev-file-name (expand-file-name "abbrev_defs" user-emacs-directory)) From f0c6a50a321fdf652351070069be3195263b7686 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 31 Jan 2026 16:37:45 -0500 Subject: [PATCH 006/113] init.el: Move a few sexp to the Misc section --- init.el | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/init.el b/init.el index 2012633..119c455 100644 --- a/init.el +++ b/init.el @@ -118,6 +118,14 @@ ;; Benefit: you never lose bookmarks if Emacs crashes. (setq bookmark-save-flag 1) +(setq uniquify-buffer-name-style 'forward) + +(setq display-time-default-load-average nil) ; Omit load average + +;; Disable fontification during user input to reduce lag in large buffers. +;; Also helps marginally with scrolling performance. +(setq redisplay-skip-fontification-on-input t) + ;;; Tramp (setq tramp-verbose 1) @@ -140,10 +148,6 @@ (setq split-width-threshold 170 split-height-threshold nil) -;;; Buffers - -(setq uniquify-buffer-name-style 'forward) - ;;; comint (general command interpreter in a window) (setq ansi-color-for-comint-mode t @@ -255,12 +259,6 @@ window-divider-default-places t window-divider-default-right-width 1) -;;; Fontification - -;; Disable fontification during user input to reduce lag in large buffers. -;; Also helps marginally with scrolling performance. -(setq redisplay-skip-fontification-on-input t) - ;;; Scrolling ;; Enables faster scrolling. This may result in brief periods of inaccurate @@ -381,10 +379,6 @@ ;; Eliminate delay before highlighting search matches (setq lazy-highlight-initial-delay 0) -;;; Modeline - -(setq display-time-default-load-average nil) ; Omit load average - ;;; Filetype ;; Do not notify the user each time Python tries to guess the indentation offset From 73160aa92bf653f61896c2428215137153d40aef Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 31 Jan 2026 16:52:52 -0500 Subject: [PATCH 007/113] Update init.el categories --- init.el | 59 +++++++++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/init.el b/init.el index 119c455..5d601c5 100644 --- a/init.el +++ b/init.el @@ -64,7 +64,7 @@ '(read-only t intangible t cursor-intangible t face minibuffer-prompt)) (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode) -;;; User interface +;;; Display and user interface ;; By default, Emacs "updates" its ui more often than it needs to (setq which-func-update-delay 1.0) @@ -76,6 +76,13 @@ (setq visible-bell nil) (setq ring-bell-function #'ignore) +;; Position underlines at the descent line instead of the baseline. +(setq x-underline-at-descent-line t) + +(setq truncate-string-ellipsis "…") + +(setq display-time-default-load-average nil) ; Omit load average + ;;; Show-paren (setq show-paren-delay 0.1 @@ -83,34 +90,10 @@ show-paren-when-point-inside-paren t show-paren-when-point-in-periphery t) -;;; Misc +;;; Buffer management (setq custom-buffer-done-kill t) -(setq whitespace-line-column nil) ; Use the value of `fill-column'. - -;; Can be activated with `display-line-numbers-mode' -(setq-default display-line-numbers-width 3) -(setq-default display-line-numbers-widen t) - -(setq truncate-string-ellipsis "…") - -;; Disable truncation of printed s-expressions in the message buffer -(setq eval-expression-print-length nil - eval-expression-print-level nil) - -;; Position underlines at the descent line instead of the baseline. -(setq x-underline-at-descent-line t) - -(setq remote-file-name-inhibit-cache 50) - -;; Automatically rescan the buffer for Imenu entries when `imenu' is invoked -;; This ensures the index reflects recent edits. -(setq imenu-auto-rescan t) - -;; Prevent truncation of long function names in `imenu' listings -(setq imenu-max-item-length 160) - ;; Disable auto-adding a new line at the bottom when scrolling. (setq next-line-add-newlines nil) @@ -120,12 +103,34 @@ (setq uniquify-buffer-name-style 'forward) -(setq display-time-default-load-average nil) ; Omit load average +(setq remote-file-name-inhibit-cache 50) ;; Disable fontification during user input to reduce lag in large buffers. ;; Also helps marginally with scrolling performance. (setq redisplay-skip-fontification-on-input t) +;;; Misc + +(setq whitespace-line-column nil) ; Use the value of `fill-column'. + +;; Disable truncation of printed s-expressions in the message buffer +(setq eval-expression-print-length nil + eval-expression-print-level nil) + +;;; `display-line-numbers-mode' + +(setq-default display-line-numbers-width 3) +(setq-default display-line-numbers-widen t) + +;;; imenu + +;; Automatically rescan the buffer for Imenu entries when `imenu' is invoked +;; This ensures the index reflects recent edits. +(setq imenu-auto-rescan t) + +;; Prevent truncation of long function names in `imenu' listings +(setq imenu-max-item-length 160) + ;;; Tramp (setq tramp-verbose 1) From 3d4ff3e459b432ced6c0e65b5742dca36ec2032f Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 31 Jan 2026 16:55:56 -0500 Subject: [PATCH 008/113] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f08ae29..b6c5d45 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # *minimal-emacs.d* - A Customizable Emacs `init.el` and `early-init.el` that Provides Better Defaults and Faster Startup -![](https://jamescherti.com/misc/made-for-gnu-emacs.svg) ![Build Status](https://github.com/jamescherti/minimal-emacs.d/actions/workflows/ci.yml/badge.svg) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) +![](https://jamescherti.com/misc/made-for-gnu-emacs.svg) ## Introduction From 6c818a3139e1d3e98bf9ed24dfcbe96294e978d4 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 31 Jan 2026 17:09:06 -0500 Subject: [PATCH 009/113] early-init: use-package/package section --- early-init.el | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/early-init.el b/early-init.el index e20956b..8069e06 100644 --- a/early-init.el +++ b/early-init.el @@ -463,20 +463,19 @@ this stage of initialization." (setq tls-checktrust t) ; Ensure SSL/TLS connections undergo trust verification (setq gnutls-min-prime-bits 3072) ; Stronger GnuTLS encryption -;;; package.el -(setq use-package-compute-statistics minimal-emacs-debug) - -;; Setting use-package-expand-minimally to (t) results in a more compact output -;; that emphasizes performance over clarity. +;; This results in a more compact output that emphasizes performance (setq use-package-expand-minimally (not noninteractive)) -(setq package-quickstart-file - (expand-file-name "package-quickstart.el" user-emacs-directory)) +(setq use-package-compute-statistics minimal-emacs-debug) (setq use-package-minimum-reported-time (if minimal-emacs-debug 0 0.1)) (setq use-package-verbose minimal-emacs-debug) -(setq package-enable-at-startup nil) ; Let the init.el file handle this (setq use-package-always-ensure t) (setq use-package-enable-imenu-support t) + +;; package.el +(setq package-enable-at-startup nil) ; Let the init.el file handle this +(setq package-quickstart-file + (expand-file-name "package-quickstart.el" user-emacs-directory)) (setq package-archives '(("melpa" . "https://melpa.org/packages/") ("gnu" . "https://elpa.gnu.org/packages/") ("nongnu" . "https://elpa.nongnu.org/nongnu/") From 489a648a30123c20b4f80b705e8f42c5db0ac5d3 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 2 Feb 2026 20:46:21 -0500 Subject: [PATCH 010/113] Update README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index b6c5d45..c47dee4 100644 --- a/README.md +++ b/README.md @@ -855,6 +855,15 @@ Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency (setq evil-collection-setup-minibuffer t) :config (evil-collection-init)) + +;; The goto-chg package is useful with Evil to jump directly to the most recent +;; edit location. This mirrors Vim's change navigation, allowing fast return to +;; where text was last modified without relying on the jump list or search. +;; +;; The goto-chg commands are bound to g; and g, +(use-package goto-chg + :commands (goto-last-change + goto-last-change-reverse)) ``` You can also install the [vim-tab-bar](https://github.com/jamescherti/vim-tab-bar.el) package to enhance the built-in Emacs tab-bar with a minimalist, Vim-inspired design that automatically adapts to the active Emacs theme. Beyond its Vim-inspired design, the *vim-tab-bar* package is valued by users who prioritize theme consistency, as it integrates the Emacs tab-bar with any Emacs theme, producing a visually coherent and polished interface: From 09c78c8f7a9e9bbe27599d8f9cdf6a053e9d63d4 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 2 Feb 2026 21:08:49 -0500 Subject: [PATCH 011/113] Update README.md --- README.md | 667 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 352 insertions(+), 315 deletions(-) diff --git a/README.md b/README.md index c47dee4..9ec3db8 100644 --- a/README.md +++ b/README.md @@ -96,28 +96,29 @@ Please share your configuration. It could serve as inspiration for other users. - [Code completion with corfu](#code-completion-with-corfu) - [Configuring Vertico, Consult, and Embark](#configuring-vertico-consult-and-embark) - [Code folding](#code-folding) - - [Changing the default theme](#changing-the-default-theme) - - [Automatic removal of trailing whitespace on save](#automatic-removal-of-trailing-whitespace-on-save) - [Enhancing undo/redo](#enhancing-undoredo) + - [Changing the default theme](#changing-the-default-theme) - [Configuring Vim keybindings using Evil?](#configuring-vim-keybindings-using-evil) - - [Configuring LSP Servers with Eglot (built-in)](#configuring-lsp-servers-with-eglot-built-in) - [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) + - [Asynchronous code formatting without cursor disruption](#asynchronous-code-formatting-without-cursor-disruption) + - [Context-aware 'go to definition' functionality for 50+ programming languages](#context-aware-go-to-definition-functionality-for-50-programming-languages) + - [Efficient template expansion with snippets](#efficient-template-expansion-with-snippets) + - [Automatic removal of trailing whitespace on save](#automatic-removal-of-trailing-whitespace-on-save) + - [Highlighting uncommitted changes in the buffer margin (e.g., Git changes)](#highlighting-uncommitted-changes-in-the-buffer-margin-eg-git-changes) + - [Spell checker](#spell-checker) + - [Configuring org-mode](#configuring-org-mode) + - [Configuring LSP Servers with Eglot (built-in)](#configuring-lsp-servers-with-eglot-built-in) - [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) - - [Efficient template expansion with snippets](#efficient-template-expansion-with-snippets) - [A better Emacs *help* buffer](#a-better-emacs-help-buffer) + - [Efficient jumps](#efficient-jumps) - [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) - - [Highlighting uncommitted changes in the buffer margin (e.g., Git changes)](#highlighting-uncommitted-changes-in-the-buffer-margin-eg-git-changes) - [Persisting Text Scale](#persisting-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) @@ -686,6 +687,38 @@ For folding based on indentation levels, the **[outline-indent](https://github.c ![](https://raw.githubusercontent.com/jamescherti/outline-indent.el/main/.images/screenshot2.png) +### Enhancing undo/redo + +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: + +1. **Redo requires two steps**: To redo an action after undoing, you need to press a key twice, which can be annoying and inefficient. +2. **Accidental over-redo**: When redoing, it's easy to go too far back, past the point where you started the undo, which makes it hard to return to the exact state you wanted to restore. + +To install and configure these packages, add the following to `~/.emacs.d/post-init.el`: +```emacs-lisp +;; The undo-fu package is a lightweight wrapper around Emacs' built-in undo +;; system, providing more convenient undo/redo functionality. +(use-package undo-fu + :ensure t + :commands (undo-fu-only-undo + undo-fu-only-redo + undo-fu-only-redo-all + undo-fu-disable-checkpoint) + :config + (global-unset-key (kbd "C-z")) + (global-set-key (kbd "C-z") 'undo-fu-only-undo) + (global-set-key (kbd "C-S-z") 'undo-fu-only-redo)) + +;; The undo-fu-session package complements undo-fu by enabling the saving +;; and restoration of undo history across Emacs sessions, even after restarting. +(use-package undo-fu-session + :ensure t + :commands undo-fu-session-global-mode + :hook (after-init . undo-fu-session-global-mode)) +``` + ### Changing the default theme For instance, to switch to a another theme than the default one, add the following to the `~/.emacs.d/post-init.el` file: @@ -730,74 +763,6 @@ If you're interested in exploring third-party Emacs themes, consider the followi - `doom-themes` (available on MELPA): An extensive collection of high-quality, visually appealing themes for Emacs, designed to offer a sleek and modern aesthetic, while drawing inspiration from popular community themes. - `tomorrow-night-deepblue-theme` (available on MELPA): A beautiful deep blue variant of the Tomorrow Night theme, which is renowned for its elegant color palette. It features a deep blue background color that creates a calming atmosphere. This theme is a great choice for those who miss the blue themes that were trendy a few years ago. (The theme was inspired by classic text editors such as QuickBASIC, RHIDE, and Turbo Pascal, as well as tools such as Midnight Commander.) -### Automatic removal of trailing whitespace on save - -**Trailing whitespace** refers to any spaces or tabs that appear after the last non-whitespace character on a line. These characters have no semantic value and can lead to unnecessary diffs in version control, inconsistent formatting, or visual clutter. Removing them improves code clarity and consistency. - -The [stripspace](https://github.com/jamescherti/stripspace.el) Emacs package provides `stripspace-local-mode`, a minor mode that automatically removes trailing whitespace and blank lines at the end of the buffer when saving. - -To enable **stripspace** and automatically delete trailing whitespace, add the following configuration to `~/.emacs.d/post-init.el`: -```elisp -;; The stripspace Emacs package provides stripspace-local-mode, a minor mode -;; that automatically removes trailing whitespace and blank lines at the end of -;; the buffer when saving. -(use-package stripspace - :ensure t - :commands stripspace-local-mode - - ;; Enable for prog-mode-hook, text-mode-hook, conf-mode-hook - :hook ((prog-mode . stripspace-local-mode) - (text-mode . stripspace-local-mode) - (conf-mode . stripspace-local-mode)) - - :custom - ;; The `stripspace-only-if-initially-clean' option: - ;; - nil to always delete trailing whitespace. - ;; - Non-nil to only delete whitespace when the buffer is clean initially. - ;; (The initial cleanliness check is performed when `stripspace-local-mode' - ;; is enabled.) - (stripspace-only-if-initially-clean nil) - - ;; Enabling `stripspace-restore-column' preserves the cursor's column position - ;; even after stripping spaces. This is useful in scenarios where you add - ;; extra spaces and then save the file. Although the spaces are removed in the - ;; saved file, the cursor remains in the same position, ensuring a consistent - ;; editing experience without affecting cursor placement. - (stripspace-restore-column t)) -``` - -### Enhancing undo/redo - -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: - -1. **Redo requires two steps**: To redo an action after undoing, you need to press a key twice, which can be annoying and inefficient. -2. **Accidental over-redo**: When redoing, it's easy to go too far back, past the point where you started the undo, which makes it hard to return to the exact state you wanted to restore. - -To install and configure these packages, add the following to `~/.emacs.d/post-init.el`: -```emacs-lisp -;; The undo-fu package is a lightweight wrapper around Emacs' built-in undo -;; system, providing more convenient undo/redo functionality. -(use-package undo-fu - :ensure t - :commands (undo-fu-only-undo - undo-fu-only-redo - undo-fu-only-redo-all - undo-fu-disable-checkpoint) - :config - (global-unset-key (kbd "C-z")) - (global-set-key (kbd "C-z") 'undo-fu-only-undo) - (global-set-key (kbd "C-S-z") 'undo-fu-only-redo)) - -;; The undo-fu-session package complements undo-fu by enabling the saving -;; and restoration of undo history across Emacs sessions, even after restarting. -(use-package undo-fu-session - :ensure t - :commands undo-fu-session-global-mode - :hook (after-init . undo-fu-session-global-mode)) -``` - ### Configuring Vim keybindings using Evil? Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency if you are accustomed to Vim's modal editing style. Add the following to `~/.emacs.d/post-init.el` to set up [Evil mode](https://github.com/emacs-evil/evil): @@ -917,44 +882,6 @@ You can also add the following code to enable commenting and uncommenting by pre (evil-define-key 'normal 'global (kbd "gc") 'my-evil-comment-or-uncomment)) ``` -### Configuring LSP Servers with Eglot (built-in) - -To set up Language Server Protocol (LSP) servers using Eglot, you can configure it, add the following to `~/.emacs.d/post-init.el`: -``` emacs-lisp -;; Set up the Language Server Protocol (LSP) servers using Eglot. -(use-package eglot - :ensure nil - :commands (eglot-ensure - eglot-rename - eglot-format-buffer)) -``` - -Here is an example of how to configure Eglot to enable or disable certain options for the `pylsp` server in Python development. (Note that a third-party tool, [python-lsp-server](https://github.com/python-lsp/python-lsp-server), must be installed): - -``` emacs-lisp -;; Configure Eglot to enable or disable certain options for the pylsp server -;; in Python development. (Note that a third-party tool, -;; https://github.com/python-lsp/python-lsp-server, must be installed), -(add-hook 'python-mode-hook #'eglot-ensure) -(add-hook 'python-ts-mode-hook #'eglot-ensure) -(setq-default eglot-workspace-configuration - `(:pylsp (:plugins - (;; Fix imports and syntax using `eglot-format-buffer` - :isort (:enabled t) - :autopep8 (:enabled t) - - ;; Syntax checkers (works with Flymake) - :pylint (:enabled t) - :pycodestyle (:enabled t) - :flake8 (:enabled t) - :pyflakes (:enabled t) - :pydocstyle (:enabled t) - :mccabe (:enabled t) - - :yapf (:enabled :json-false) - :rope_autoimport (:enabled :json-false))))) -``` - ### 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. @@ -995,41 +922,6 @@ To configure **easysession**, add the following to `~/.emacs.d/post-init.el`: (add-hook 'emacs-startup-hook #'easysession-save-mode 103)) ``` -### Configuring org-mode - -Org mode is a major mode designed for organizing notes, planning, task management, and authoring documents using plain text with a simple and expressive markup syntax. It supports hierarchical outlines, TODO lists, scheduling, deadlines, time tracking, and exporting to multiple formats including HTML, LaTeX, PDF, and Markdown. - -To configure **org-mode**, add the following to `~/.emacs.d/post-init.el`: -```elisp -;; Org mode is a major mode designed for organizing notes, planning, task -;; management, and authoring documents using plain text with a simple and -;; expressive markup syntax. It supports hierarchical outlines, TODO lists, -;; scheduling, deadlines, time tracking, and exporting to multiple formats -;; including HTML, LaTeX, PDF, and Markdown. -(use-package org - :ensure t - :commands (org-mode org-version) - :mode - ("\\.org\\'" . org-mode) - :custom - (org-hide-leading-stars t) - (org-startup-indented t) - (org-adapt-indentation nil) - (org-edit-src-content-indentation 0) - ;; (org-fontify-done-headline t) - ;; (org-fontify-todo-headline t) - ;; (org-fontify-whole-heading-line t) - ;; (org-fontify-quote-and-verse-blocks t) - (org-startup-truncated t)) -``` - -The `org-appear` package temporarily reveals normally hidden elements (such as emphasis markers, links, or entities) when the cursor enters them, and hides them again when the cursor leaves. To configure **org-appear**, add the following to `~/.emacs.d/post-init.el`: -```elisp -(use-package org-appear - :commands org-appear-mode - :hook (org-mode . org-appear-mode)) -``` - ### Configuring markdown-mode (e.g., README.md syntax) The [markdown-mode](https://github.com/jrblevin/markdown-mode) package provides a major mode for Emacs for syntax highlighting, editing commands, and preview support for Markdown documents. It supports core Markdown syntax as well as extensions like GitHub Flavored Markdown (GFM). @@ -1078,6 +970,297 @@ These commands work on any Markdown buffer and rely on properly formatted header 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/). +### 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. + +Apheleia solves both problems across all languages, replacing language-specific packages like Blacken and prettier-js. It does this by invoking formatters in an `after-save-hook`, ensuring changes are applied only if the buffer remains unmodified. + +To maintain cursor stability, Apheleia generates an RCS patch, applies it selectively, and employs a dynamic programming algorithm to reposition the cursor if necessary. If the formatting alters the vertical position of the cursor in the window, Apheleia adjusts the scroll position to preserve visual continuity across all displayed instances of the buffer. This allows enjoying automated code formatting without sacrificing editor responsiveness or usability. + +To configure **apheleia**, add the following to `~/.emacs.d/post-init.el`: +```elisp +;; Apheleia is an Emacs package designed to run code formatters (e.g., Shfmt, +;; Black and Prettier) asynchronously without disrupting the cursor position. +(use-package apheleia + :ensure t + :commands (apheleia-mode + apheleia-global-mode) + :hook ((prog-mode . apheleia-mode))) +``` + +### Context-aware 'go to definition' functionality for 50+ programming languages + +The [dumb-jump](https://github.com/jacktasia/dumb-jump) package provides context-aware 'go to definition' functionality for 50+ programming languages without requiring a language server. It works by using simple heuristics and regular expression searches to locate the definitions of functions, variables, and symbols across project files. + +Unlike more sophisticated language-aware tools (e.g., eglot or lsp-mode), `dumb-jump' does not parse code semantically, which makes it lightweight and fast, but sometimes less precise. It integrates with popular navigation packages like `xref', allowing users to jump to definitions or references. + +To configure **dumb-jump**, add the following to `~/.emacs.d/post-init.el`: +```elisp +(lightemacs-use-package dumb-jump + :commands dumb-jump-xref-activate + :init + ;; Register `dumb-jump' as an xref backend so it integrates with + ;; `xref-find-definitions' + (add-hook 'xref-backend-functions #'dumb-jump-xref-activate) + + (setq dumb-jump-aggressive nil) + ;; (setq dumb-jump-quiet t) + + ;; Number of seconds a rg/grep/find command can take before being warned to + ;; use ag and config. + (setq dumb-jump-max-find-time 3) + + ;; Use `completing-read' so that selection of jump targets integrates with the + ;; active completion framework (e.g., Vertico, Ivy, Helm, Icomplete), + ;; providing a consistent minibuffer-based interface whenever multiple + ;; definitions are found. + (setq dumb-jump-selector 'completing-read) + + ;; If ripgrep is available, force `dumb-jump' to use it because it is + ;; significantly faster and more accurate than the default searchers (grep, + ;; ag, etc.). + (when (executable-find "rg") + (setq dumb-jump-force-searcher 'rg) + (setq dumb-jump-prefer-searcher 'rg))) +``` + +### 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. 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... + +(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)) +``` + +### Automatic removal of trailing whitespace on save + +**Trailing whitespace** refers to any spaces or tabs that appear after the last non-whitespace character on a line. These characters have no semantic value and can lead to unnecessary diffs in version control, inconsistent formatting, or visual clutter. Removing them improves code clarity and consistency. + +The [stripspace](https://github.com/jamescherti/stripspace.el) Emacs package provides `stripspace-local-mode`, a minor mode that automatically removes trailing whitespace and blank lines at the end of the buffer when saving. + +To enable **stripspace** and automatically delete trailing whitespace, add the following configuration to `~/.emacs.d/post-init.el`: +```elisp +;; The stripspace Emacs package provides stripspace-local-mode, a minor mode +;; that automatically removes trailing whitespace and blank lines at the end of +;; the buffer when saving. +(use-package stripspace + :ensure t + :commands stripspace-local-mode + + ;; Enable for prog-mode-hook, text-mode-hook, conf-mode-hook + :hook ((prog-mode . stripspace-local-mode) + (text-mode . stripspace-local-mode) + (conf-mode . stripspace-local-mode)) + + :custom + ;; The `stripspace-only-if-initially-clean' option: + ;; - nil to always delete trailing whitespace. + ;; - Non-nil to only delete whitespace when the buffer is clean initially. + ;; (The initial cleanliness check is performed when `stripspace-local-mode' + ;; is enabled.) + (stripspace-only-if-initially-clean nil) + + ;; Enabling `stripspace-restore-column' preserves the cursor's column position + ;; even after stripping spaces. This is useful in scenarios where you add + ;; extra spaces and then save the file. Although the spaces are removed in the + ;; saved file, the cursor remains in the same position, ensuring a consistent + ;; editing experience without affecting cursor placement. + (stripspace-restore-column t)) +``` + +### Highlighting uncommitted changes in the buffer margin (e.g., Git changes) + +The [diff-hl](https://github.com/dgutov/diff-hl) package highlights uncommitted changes in the window margin, enabling navigation between them. Also known as source control gutter indicators, it displays added, modified, and deleted lines in real time. In Git-controlled buffers, changes can be staged and unstaged directly, providing a clear view of version-control changes without running `git diff`. By default, the module does not start `diff-hl-mode` automatically. + +![](https://raw.githubusercontent.com/dgutov/diff-hl/refs/heads/master/screenshot.png) + +To configure the *diff-hl* package, add the following to your `~/.emacs.d/post-init.el`: +```elisp +(use-package diff-hl + :commands (diff-hl-mode + global-diff-hl-mode) + :hook (prog-mode . diff-hl-mode) + :init + (setq diff-hl-flydiff-delay 0.4) ; Faster + (setq diff-hl-show-staged-changes nil) ; Realtime feedback + (setq diff-hl-update-async t) ; Do not block Emacs + (setq diff-hl-global-modes '(not pdf-view-mode image-mode))) +``` + +### Spell checker + +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 +;; 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. +(use-package ispell + :ensure nil + :commands (ispell ispell-minor-mode) + :custom + ;; 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. + (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"))) + +;; 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. +(use-package flyspell + :ensure nil + :commands flyspell-mode + :hook + (; (prog-mode . flyspell-prog-mode) + (text-mode . (lambda() + (if (or (derived-mode-p 'yaml-mode) + (derived-mode-p 'yaml-ts-mode) + (derived-mode-p 'ansible-mode)) + (flyspell-prog-mode 1) + (flyspell-mode 1))))) + :config + ;; Remove strings from Flyspell + (setq flyspell-prog-text-faces (delq 'font-lock-string-face + flyspell-prog-text-faces)) + + ;; Remove doc from Flyspell + (setq flyspell-prog-text-faces (delq 'font-lock-doc-face + flyspell-prog-text-faces))) +``` + +### Configuring org-mode + +Org mode is a major mode designed for organizing notes, planning, task management, and authoring documents using plain text with a simple and expressive markup syntax. It supports hierarchical outlines, TODO lists, scheduling, deadlines, time tracking, and exporting to multiple formats including HTML, LaTeX, PDF, and Markdown. + +To configure **org-mode**, add the following to `~/.emacs.d/post-init.el`: +```elisp +;; Org mode is a major mode designed for organizing notes, planning, task +;; management, and authoring documents using plain text with a simple and +;; expressive markup syntax. It supports hierarchical outlines, TODO lists, +;; scheduling, deadlines, time tracking, and exporting to multiple formats +;; including HTML, LaTeX, PDF, and Markdown. +(use-package org + :ensure t + :commands (org-mode org-version) + :mode + ("\\.org\\'" . org-mode) + :custom + (org-hide-leading-stars t) + (org-startup-indented t) + (org-adapt-indentation nil) + (org-edit-src-content-indentation 0) + ;; (org-fontify-done-headline t) + ;; (org-fontify-todo-headline t) + ;; (org-fontify-whole-heading-line t) + ;; (org-fontify-quote-and-verse-blocks t) + (org-startup-truncated t)) +``` + +The `org-appear` package temporarily reveals normally hidden elements (such as emphasis markers, links, or entities) when the cursor enters them, and hides them again when the cursor leaves. To configure **org-appear**, add the following to `~/.emacs.d/post-init.el`: +```elisp +(use-package org-appear + :commands org-appear-mode + :hook (org-mode . org-appear-mode)) +``` + +### Configuring LSP Servers with Eglot (built-in) + +To set up Language Server Protocol (LSP) servers using Eglot, you can configure it, add the following to `~/.emacs.d/post-init.el`: +``` emacs-lisp +;; Set up the Language Server Protocol (LSP) servers using Eglot. +(use-package eglot + :ensure nil + :commands (eglot-ensure + eglot-rename + eglot-format-buffer)) +``` + +Here is an example of how to configure Eglot to enable or disable certain options for the `pylsp` server in Python development. (Note that a third-party tool, [python-lsp-server](https://github.com/python-lsp/python-lsp-server), must be installed): + +``` emacs-lisp +;; Configure Eglot to enable or disable certain options for the pylsp server +;; in Python development. (Note that a third-party tool, +;; https://github.com/python-lsp/python-lsp-server, must be installed), +(add-hook 'python-mode-hook #'eglot-ensure) +(add-hook 'python-ts-mode-hook #'eglot-ensure) +(setq-default eglot-workspace-configuration + `(:pylsp (:plugins + (;; Fix imports and syntax using `eglot-format-buffer` + :isort (:enabled t) + :autopep8 (:enabled t) + + ;; Syntax checkers (works with Flymake) + :pylint (:enabled t) + :pycodestyle (:enabled t) + :flake8 (:enabled t) + :pyflakes (:enabled t) + :pydocstyle (:enabled t) + :mccabe (:enabled t) + + :yapf (:enabled :json-false) + :rope_autoimport (:enabled :json-false))))) +``` + ### 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. @@ -1326,152 +1509,6 @@ To configure **inhibit-mouse**, add the following to `~/.emacs.d/post-init.el`: NOTE: `inhibit-mouse-mode` allows users to disable and re-enable mouse functionality, giving them the flexibility to use the mouse when needed. -### Spell checker - -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 -;; 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. -(use-package ispell - :ensure nil - :commands (ispell ispell-minor-mode) - :custom - ;; 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. - (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"))) - -;; 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. -(use-package flyspell - :ensure nil - :commands flyspell-mode - :hook - (; (prog-mode . flyspell-prog-mode) - (text-mode . (lambda() - (if (or (derived-mode-p 'yaml-mode) - (derived-mode-p 'yaml-ts-mode) - (derived-mode-p 'ansible-mode)) - (flyspell-prog-mode 1) - (flyspell-mode 1))))) - :config - ;; Remove strings from Flyspell - (setq flyspell-prog-text-faces (delq 'font-lock-string-face - flyspell-prog-text-faces)) - - ;; Remove doc from Flyspell - (setq flyspell-prog-text-faces (delq 'font-lock-doc-face - 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. - -Apheleia solves both problems across all languages, replacing language-specific packages like Blacken and prettier-js. It does this by invoking formatters in an `after-save-hook`, ensuring changes are applied only if the buffer remains unmodified. - -To maintain cursor stability, Apheleia generates an RCS patch, applies it selectively, and employs a dynamic programming algorithm to reposition the cursor if necessary. If the formatting alters the vertical position of the cursor in the window, Apheleia adjusts the scroll position to preserve visual continuity across all displayed instances of the buffer. This allows enjoying automated code formatting without sacrificing editor responsiveness or usability. - -To configure **apheleia**, add the following to `~/.emacs.d/post-init.el`: -```elisp -;; Apheleia is an Emacs package designed to run code formatters (e.g., Shfmt, -;; Black and Prettier) asynchronously without disrupting the cursor position. -(use-package apheleia - :ensure t - :commands (apheleia-mode - apheleia-global-mode) - :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. 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... - -(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](https://github.com/Wilfred/helpful) is an alternative to the built-in Emacs help that provides much more contextual information. @@ -1498,6 +1535,25 @@ To configure **helpful**, add the following to `~/.emacs.d/post-init.el`: (helpful-max-buffers 7)) ``` +### Efficient jumps + +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. + ### Enhancing the Elisp development experience To enhance the Elisp development experience, add the following to `~/.emacs.d/post-init.el`: @@ -1583,25 +1639,6 @@ On Linux, you can display a comprehensive list of all installed font families by fc-list : family | sed 's/,/\n/g' | sort -u ``` -### Highlighting uncommitted changes in the buffer margin (e.g., Git changes) - -The [diff-hl](https://github.com/dgutov/diff-hl) package highlights uncommitted changes in the window margin, enabling navigation between them. Also known as source control gutter indicators, it displays added, modified, and deleted lines in real time. In Git-controlled buffers, changes can be staged and unstaged directly, providing a clear view of version-control changes without running `git diff`. By default, the module does not start `diff-hl-mode` automatically. - -![](https://raw.githubusercontent.com/dgutov/diff-hl/refs/heads/master/screenshot.png) - -To configure the *diff-hl* package, add the following to your `~/.emacs.d/post-init.el`: -```elisp -(use-package diff-hl - :commands (diff-hl-mode - global-diff-hl-mode) - :hook (prog-mode . diff-hl-mode) - :init - (setq diff-hl-flydiff-delay 0.4) ; Faster - (setq diff-hl-show-staged-changes nil) ; Realtime feedback - (setq diff-hl-update-async t) ; Do not block Emacs - (setq diff-hl-global-modes '(not pdf-view-mode image-mode))) -``` - ### Persisting 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. From c585f045bfe3fa2030f5166e507698f147e6bd67 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 2 Feb 2026 21:12:45 -0500 Subject: [PATCH 012/113] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9ec3db8..8dd01cc 100644 --- a/README.md +++ b/README.md @@ -1001,8 +1001,9 @@ To configure **dumb-jump**, add the following to `~/.emacs.d/post-init.el`: :commands dumb-jump-xref-activate :init ;; Register `dumb-jump' as an xref backend so it integrates with - ;; `xref-find-definitions' - (add-hook 'xref-backend-functions #'dumb-jump-xref-activate) + ;; `xref-find-definitions'. A priority of 90 ensures it is used only when no + ;; more specific backend is available. + (add-hook 'xref-backend-functions #'dumb-jump-xref-activate 90) (setq dumb-jump-aggressive nil) ;; (setq dumb-jump-quiet t) From 020cbbee8eedd8aca47749801185dd198e2ab636 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 2 Feb 2026 21:15:02 -0500 Subject: [PATCH 013/113] Update README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 8dd01cc..733ed57 100644 --- a/README.md +++ b/README.md @@ -1683,6 +1683,15 @@ In Emacs, customization variables modified via the UI (e.g., `M-x customize`) ar 2. You can also add the following to `~/.emacs.d/post-init.el`: ```emacs-lisp +;;; Enable automatic insertion and management of matching pairs of characters +;;; (e.g., (), {}, "") globally using `electric-pair-mode'. +(use-package elec-pair + :ensure nil + :commands (electric-pair-mode + electric-pair-local-mode + electric-pair-delete-pair) + :hook (after-init . electric-pair-mode)) + ;; Allow Emacs to upgrade built-in packages, such as Org mode (setq package-install-upgrade-built-in t) From b932f696656443ab180c36a0cfdb2395e04b531c Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 2 Feb 2026 21:16:38 -0500 Subject: [PATCH 014/113] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 733ed57..5438a69 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's - [xzway on Reddit](https://www.reddit.com/r/emacs/comments/1p9y8h4/comment/nrh8dye/): "The minimal-emacs.d configuration is very well-designed and non-intrusive. I'm also using it to refactor my configuration." - [jeenajeena on Reddit](https://www.reddit.com/r/emacs/comments/1p9y8h4/comment/nrfk13i/): "Thank you. Plenty of inspiring settings. Worth to be read line by line." - [uutangohotel on Reddit](https://www.reddit.com/r/emacs/comments/1p9y8h4/comment/nrg5kja/): "I get a lot out of minimal-emacs.d — thank you! I use stow to manage my dotfiles in a git repo. I created a submodule in one dir for minimal-emacs.d and another for my “overrides”, e.g. post-init.el. Easy and works great." -- [sunng on Reddit](https://www.reddit.com/r/emacs/comments/1p9y8h4/comment/ns1nehi/): "Nice work! I just created a nix flake to using it on my dev servers https://codeberg.org/sunng/minimal-emacs.d-nix-hm " +- [sunng on Reddit](https://www.reddit.com/r/emacs/comments/1p9y8h4/comment/ns1nehi/): "Nice work! I just created a nix flake to using it on my dev servers" Please share your configuration. It could serve as inspiration for other users. From 7bef045941dcf219ca2245287b514f62df96a234 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 2 Feb 2026 21:26:30 -0500 Subject: [PATCH 015/113] Update README.md --- README.md | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 5438a69..57b855d 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,6 @@ Please share your configuration. It could serve as inspiration for other users. - [Spell checker](#spell-checker) - [Configuring org-mode](#configuring-org-mode) - [Configuring LSP Servers with Eglot (built-in)](#configuring-lsp-servers-with-eglot-built-in) - - [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) @@ -117,6 +116,7 @@ Please share your configuration. It could serve as inspiration for other users. - [A better Emacs *help* buffer](#a-better-emacs-help-buffer) - [Efficient jumps](#efficient-jumps) - [Enhancing the Elisp development experience](#enhancing-the-elisp-development-experience) + - [Tree-sitter Integration (Better Syntax Highlighting)](#tree-sitter-integration-better-syntax-highlighting) - [Showing the tab-bar](#showing-the-tab-bar) - [Changing the Default Font](#changing-the-default-font) - [Persisting Text Scale](#persisting-text-scale) @@ -1262,29 +1262,6 @@ Here is an example of how to configure Eglot to enable or disable certain option :rope_autoimport (:enabled :json-false))))) ``` -### 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. - -The configuration below enables Tree-sitter support using the [treesit-auto](https://github.com/renzmann/treesit-auto) package. Setting `treesit-auto-add-to-auto-mode-alist` to `'all` ensures that all available Tree-sitter modes are automatically activated for their corresponding file types. Enabling `global-treesit-auto-mode` applies this behavior globally, improving syntax accuracy and consistency across supported languages. - -To enable Tree-sitter, add the following to your `~/.emacs.d/post-init.el`: - -```elisp -;; Tree-sitter in Emacs is an incremental parsing system introduced in Emacs 29 -;; that provides precise, high-performance syntax highlighting. 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. -(use-package treesit-auto - :ensure t - :custom - (treesit-auto-install 'prompt) - :config - (treesit-auto-add-to-auto-mode-alist 'all) - (global-treesit-auto-mode)) -``` - ### Auto upgrade Emacs packages The [auto-package-update](https://github.com/rranelli/auto-package-update.el) 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. @@ -1612,6 +1589,29 @@ Other optional packages that may be useful include: elisp-refs-symbol)) ``` +### 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. + +The configuration below enables Tree-sitter support using the [treesit-auto](https://github.com/renzmann/treesit-auto) package. Setting `treesit-auto-add-to-auto-mode-alist` to `'all` ensures that all available Tree-sitter modes are automatically activated for their corresponding file types. Enabling `global-treesit-auto-mode` applies this behavior globally, improving syntax accuracy and consistency across supported languages. + +To enable Tree-sitter, add the following to your `~/.emacs.d/post-init.el`: + +```elisp +;; Tree-sitter in Emacs is an incremental parsing system introduced in Emacs 29 +;; that provides precise, high-performance syntax highlighting. 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. +(use-package treesit-auto + :ensure t + :custom + (treesit-auto-install 'prompt) + :config + (treesit-auto-add-to-auto-mode-alist 'all) + (global-treesit-auto-mode)) +``` + ### Showing the tab-bar Configure the `tab-bar-show` variable to 1 to display the tab bar exclusively when multiple tabs are open: From a8ec9ecefc7dfb880992912da521afbb06f91abf Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 3 Feb 2026 08:36:22 -0500 Subject: [PATCH 016/113] Update README.md --- README.md | 91 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 73 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 57b855d..fde12b9 100644 --- a/README.md +++ b/README.md @@ -7,23 +7,7 @@ The **minimal-emacs.d** project is a lightweight and optimized Emacs base (`init.el` and `early-init.el`) that **gives you full control over your configuration** (without the complexity of, for instance, Doom Emacs or Spacemacs). It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup. -Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs configuration. *(More information about the *minimal-emacs.d* features can be found here: [Features](#features).)* - -If this enhances your workflow, please show your support by **⭐ starring minimal-emacs.d on GitHub** to help more Emacs users discover its benefits. - -

- -

- -**Here are the instructions for installing minimal-emacs.d:** [Install minimal-emacs.d](#install-minimal-emacsd). - -### Looking for the ideal starter kit to customize Emacs? You have found it. - -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. -- **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)) +Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive resing 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: - `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. @@ -75,7 +59,6 @@ Please share your configuration. It could serve as inspiration for other users. - [*minimal-emacs.d* - A Customizable Emacs `init.el` and `early-init.el` that Provides Better Defaults and Faster Startup](#minimal-emacsd---a-customizable-emacs-initel-and-early-initel-that-provides-better-defaults-and-faster-startup) - [Introduction](#introduction) - - [Looking for the ideal starter kit to customize Emacs? You have found it.](#looking-for-the-ideal-starter-kit-to-customize-emacs-you-have-found-it) - [Startup](#startup) - [Comments from minimal-emacs.d users](#comments-from-minimal-emacsd-users) - [Install minimal-emacs.d](#install-minimal-emacsd) @@ -122,6 +105,7 @@ Please share your configuration. It could serve as inspiration for other users. - [Persisting Text Scale](#persisting-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) + - [Other filetypes](#other-filetypes) - [Customizations: pre-early-init.el](#customizations-pre-early-initel) - [Configuring straight.el](#configuring-straightel) - [Configuring Elpaca (package manager)](#configuring-elpaca-package-manager) @@ -1838,6 +1822,77 @@ It is also recommended to read the following articles: - [Maintaining proper indentation in indentation-sensitive programming languages](https://www.jamescherti.com/elisp-code-and-emacs-packages-for-maintaining-proper-indentation-in-indentation-sensitive-languages-such-as-python-or-yaml/) +### Other filetypes + +The following additional file types may be enabled to extend language support beyond the core set. + +These modes are optional and can be added selectively to `~/.emacs.d/post-init.el`, depending on the languages and formats commonly encountered in a given workflow. +```elisp +;; Support for YAML files. +;; +;; NOTE: Prefer the tree-sitter-based yaml-ts-mode over yaml-mode when +;; available, as it provides more accurate syntax parsing and enhanced editing +;; features. +(use-package yaml-mode + :commands yaml-mode + :mode (("\\.yaml\\'" . yaml-mode) + ("\\.yml\\'" . yaml-mode))) + +;; Support for Dockerfile files. +;; +;; NOTE: Prefer the tree-sitter-based dockerfile-ts-mode over dockerfile-mode +;; when available, as it provides more accurate syntax parsing and enhanced +;; editing features. +(use-package dockerfile-mode + :commands dockerfile-mode + :mode + ("Dockerfile\\'" . dockerfile-mode)) + +;; Support for *.lua files. +;; +;; Prefer the tree-sitter-based lua-ts-mode over lua-mode when available, as it +;; provides more accurate syntax parsing and enhanced editing features. +(use-package lua-mode + :commands lua-mode + :mode ("\\.lua\\'" . lua-mode)) + +;; Jinja2 template support for files commonly used in configuration management +;; systems and web frameworks. This mode enables syntax highlighting and basic +;; editing facilities for templates written using the Jinja2 templating +;; language. +(use-package jinja2-mode + :commands jinja2-mode + :mode ("\\.j2\\'" . jinja2-mode)) + +;; CSV file support with automatic column alignment. This configuration enables +;; csv-align-mode whenever a CSV file is opened, improving readability by +;; keeping columns visually aligned according to a configurable maximum width +;; and a set of recognized field separators. +(use-package csv-mode + :commands (csv-mode + csv-align-mode) + :mode ("\\.csv\\'" . csv-mode) + :hook + (csv-mode . csv-align-mode) + :custom + (csv-align-max-width 100) + (csv-separators '(","))) + +;; Vim configuration file support. This mode provides syntax highlighting and +;; editing support for various Vim configuration files, including vimrc, gvimrc, +;; local overrides, and project-specific configuration files. +(use-package vimrc-mode + :commands vimrc-mode + :mode + ("\\.vim\\(rc\\)?\\'" . vimrc-mode)) + +;; Support for Jenkinsfile files +(use-package jenkinsfile-mode + :commands jenkinsfile-mode + :mode + ("Jenkinsfile\\'" . jenkinsfile-mode)) +``` + ## Customizations: pre-early-init.el ### Configuring straight.el From 50ab9157e9be9495a3db9a0f0dd132bcf4d0317f Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 3 Feb 2026 08:41:49 -0500 Subject: [PATCH 017/113] Update README.md --- README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index fde12b9..36e694f 100644 --- a/README.md +++ b/README.md @@ -1845,8 +1845,7 @@ These modes are optional and can be added selectively to `~/.emacs.d/post-init.e ;; editing features. (use-package dockerfile-mode :commands dockerfile-mode - :mode - ("Dockerfile\\'" . dockerfile-mode)) + :mode ("Dockerfile\\'" . dockerfile-mode)) ;; Support for *.lua files. ;; @@ -1872,8 +1871,7 @@ These modes are optional and can be added selectively to `~/.emacs.d/post-init.e :commands (csv-mode csv-align-mode) :mode ("\\.csv\\'" . csv-mode) - :hook - (csv-mode . csv-align-mode) + :hook (csv-mode . csv-align-mode) :custom (csv-align-max-width 100) (csv-separators '(","))) @@ -1883,14 +1881,12 @@ These modes are optional and can be added selectively to `~/.emacs.d/post-init.e ;; local overrides, and project-specific configuration files. (use-package vimrc-mode :commands vimrc-mode - :mode - ("\\.vim\\(rc\\)?\\'" . vimrc-mode)) + :mode ("\\.vim\\(rc\\)?\\'" . vimrc-mode)) ;; Support for Jenkinsfile files (use-package jenkinsfile-mode :commands jenkinsfile-mode - :mode - ("Jenkinsfile\\'" . jenkinsfile-mode)) + :mode ("Jenkinsfile\\'" . jenkinsfile-mode)) ``` ## Customizations: pre-early-init.el From 45164ddc0cd4f91f486583f12006739edc0f5cb7 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 3 Feb 2026 10:06:14 -0500 Subject: [PATCH 018/113] Add quick-sdcv --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 36e694f..753c896 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,7 @@ Please share your configuration. It could serve as inspiration for other users. - [Enhancing the Elisp development experience](#enhancing-the-elisp-development-experience) - [Tree-sitter Integration (Better Syntax Highlighting)](#tree-sitter-integration-better-syntax-highlighting) - [Showing the tab-bar](#showing-the-tab-bar) + - [Offline Dictionary](#offline-dictionary) - [Changing the Default Font](#changing-the-default-font) - [Persisting Text Scale](#persisting-text-scale) - [Loading the custom.el file](#loading-the-customel-file) @@ -1605,6 +1606,32 @@ Configure the `tab-bar-show` variable to 1 to display the tab bar exclusively wh (setopt tab-bar-show 1) ``` +### Offline Dictionary + +The [quick-sdcv.el](https://github.com/jamescherti/quick-sdcv.el) package serves as a lightweight Emacs interface for the `sdcv` command-line interface, which is the console version of the StarDict dictionary application. + +This package enables Emacs to function as an offline dictionary. + +To enable *quick-sdcv*, add the following to your `~/.emacs.d/post-init.el`: + +```emacs-lisp +(use-package quick-sdcv + :ensure t + :custom + (quick-sdcv-unique-buffers t) + (quick-sdcv-dictionary-prefix-symbol "►") + (quick-sdcv-ellipsis " ▼")) +``` + +Here are the main interactive functions: +- `M-x quick-sdcv-search-at-point`: Searches the word around the cursor and displays the result in a buffer. +- `M-x quick-sdcv-search-input`: Searches the input word and displays the result in a buffer. + +Prerequisite: + +- The [sdcv](https://github.com/Dushistov/sdcv) command. (It can usually be installed by installing the `sdcv` package.) +- Download dictionaries from: http://download.huzheng.org/ . Once the dictionaries are downloaded, extract them into `/usr/share/stardict/dic/`, or configure the variable `quick-sdcv-dictionary-data-dir` in the Emacs configuration to specify an alternative dictionary path. + ### Changing the Default Font To customize the default font, add the following expression to your `~/.emacs.d/post-init.el`: From 768c41e65423c02415dabaf5c6c2be75075f3032 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 3 Feb 2026 11:15:27 -0500 Subject: [PATCH 019/113] Update README.md --- README.md | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 62 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 753c896..22529ed 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ Please share your configuration. It could serve as inspiration for other users. - [Persisting Text Scale](#persisting-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) - - [Other filetypes](#other-filetypes) + - [File types (Yaml, Dockerfile, Lua, Jinja2, CSV, Vimrc...)](#file-types-yaml-dockerfile-lua-jinja2-csv-vimrc) - [Customizations: pre-early-init.el](#customizations-pre-early-initel) - [Configuring straight.el](#configuring-straightel) - [Configuring Elpaca (package manager)](#configuring-elpaca-package-manager) @@ -1849,12 +1849,23 @@ It is also recommended to read the following articles: - [Maintaining proper indentation in indentation-sensitive programming languages](https://www.jamescherti.com/elisp-code-and-emacs-packages-for-maintaining-proper-indentation-in-indentation-sensitive-languages-such-as-python-or-yaml/) -### Other filetypes +### File types (Yaml, Dockerfile, Lua, Jinja2, CSV, Vimrc...) The following additional file types may be enabled to extend language support beyond the core set. These modes are optional and can be added selectively to `~/.emacs.d/post-init.el`, depending on the languages and formats commonly encountered in a given workflow. ```elisp +;; Support for Git files (.gitconfig, .gitignore, .gitattributes...) +(use-package git-modes + :commands (gitattributes-mode + gitconfig-mode + gitignore-mode) + :mode + ("/.gitconfig\\'" . gitconfig-mode) + ("/.gitignore\\'" . gitignore-mode) + ("/.gitignore_global\\'" . gitignore-mode) + ("/.gitattributes\\'" . gitattributes-mode)) + ;; Support for YAML files. ;; ;; NOTE: Prefer the tree-sitter-based yaml-ts-mode over yaml-mode when @@ -1898,10 +1909,57 @@ These modes are optional and can be added selectively to `~/.emacs.d/post-init.e :commands (csv-mode csv-align-mode) :mode ("\\.csv\\'" . csv-mode) - :hook (csv-mode . csv-align-mode) + :hook ((csv-mode . csv-align-mode) + (csv-mode . csv-guess-set-separator)) :custom (csv-align-max-width 100) - (csv-separators '(","))) + (csv-separators '("," ";" " " "|" "\t")) + +;; Support for Go +;; +;; NOTE: Prefer the tree-sitter-based go-ts-mode over go-mode +;; when available, as it provides more accurate syntax parsing and enhanced +;; editing features. +(use-package go-mode + :commands go-mode + :mode ("\\.go\\'" . go-mode)) + +;; Support for Haskell +(use-package haskell-mode + :commands haskell-mode + :mode ("\\.hs\\'" . haskell-mode)) + +;; Major mode for editing crontab files +(use-package crontab-mode + :commands crontab-mode + :mode ("/crontab\\(\\.X*[[:alnum:]]+\\)?\\'" . crontab-mode)) + +;; Major mode for editing Nginx configuration files +(use-package nginx-mode + :commands nginx-mode + :mode (("nginx\\.conf\\'" . nginx-mode) + ("/nginx/.+\\.conf\\'" . nginx-mode))) + +;; Major mode for HashiCorp Configuration Language (HCL) files +(use-package hcl-mode + :commands hcl-mode + :mode ("\\.hcl\\'" . hcl-mode)) + +;; Major mode for Nix expression language files +(use-package nix-mode + :commands nix-mode + :mode ("\\.nix\\'" . nix-mode)) + +;; Support for common .env file syntax, typically used for environment +;; variable files +(use-package dotenv-mode + :commands dotenv-mode + :mode ("\\.env\\..*\\'" . dotenv-mode)) + +;; Major mode for editing Fish shell scripts +(use-package fish-mode + :commands fish-mode + :mode ("\\.fish\\'" . fish-mode)) ;; Vim configuration file support. This mode provides syntax highlighting and ;; editing support for various Vim configuration files, including vimrc, gvimrc, From 37076a6cf62cd4ed8e4ff979a2c4c3a3380061ac Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 3 Feb 2026 11:20:31 -0500 Subject: [PATCH 020/113] Update README.md --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 22529ed..a055d2d 100644 --- a/README.md +++ b/README.md @@ -1860,11 +1860,10 @@ These modes are optional and can be added selectively to `~/.emacs.d/post-init.e :commands (gitattributes-mode gitconfig-mode gitignore-mode) - :mode - ("/.gitconfig\\'" . gitconfig-mode) - ("/.gitignore\\'" . gitignore-mode) - ("/.gitignore_global\\'" . gitignore-mode) - ("/.gitattributes\\'" . gitattributes-mode)) + :mode (("/.gitconfig\\'" . gitconfig-mode) + ("/.gitignore\\'" . gitignore-mode) + ("/.gitignore_global\\'" . gitignore-mode) + ("/.gitattributes\\'" . gitattributes-mode))) ;; Support for YAML files. ;; @@ -1907,13 +1906,14 @@ These modes are optional and can be added selectively to `~/.emacs.d/post-init.e ;; and a set of recognized field separators. (use-package csv-mode :commands (csv-mode - csv-align-mode) + csv-align-mode + csv-guess-set-separator) :mode ("\\.csv\\'" . csv-mode) :hook ((csv-mode . csv-align-mode) (csv-mode . csv-guess-set-separator)) :custom (csv-align-max-width 100) - (csv-separators '("," ";" " " "|" "\t")) + (csv-separators '("," ";" " " "|" "\t"))) ;; Support for Go ;; @@ -1932,12 +1932,12 @@ These modes are optional and can be added selectively to `~/.emacs.d/post-init.e ;; Major mode for editing crontab files (use-package crontab-mode :commands crontab-mode - :mode ("/crontab\\(\\.X*[[:alnum:]]+\\)?\\'" . crontab-mode)) + :mode ("/crontab\\(\\.X*[[:alnum:]]+\\)?\\'" . crontab-mode)) ;; Major mode for editing Nginx configuration files (use-package nginx-mode :commands nginx-mode - :mode (("nginx\\.conf\\'" . nginx-mode) + :mode (("nginx\\.conf\\'" . nginx-mode) ("/nginx/.+\\.conf\\'" . nginx-mode))) ;; Major mode for HashiCorp Configuration Language (HCL) files From 98fc4886331399593cc4f80c89d5f826a558e2e2 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 3 Feb 2026 11:23:08 -0500 Subject: [PATCH 021/113] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index a055d2d..287fb2a 100644 --- a/README.md +++ b/README.md @@ -1929,6 +1929,12 @@ These modes are optional and can be added selectively to `~/.emacs.d/post-init.e :commands haskell-mode :mode ("\\.hs\\'" . haskell-mode)) +(use-package rust-mode + :commands rust-mode + :mode ("\\.rs$" . rust-mode) + :custom + (rust-indent-offset 2)) + ;; Major mode for editing crontab files (use-package crontab-mode :commands crontab-mode From f7f1dbd1a01cca7290501e3c4bf996b802ca83f2 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 3 Feb 2026 11:23:48 -0500 Subject: [PATCH 022/113] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 287fb2a..624f854 100644 --- a/README.md +++ b/README.md @@ -1931,7 +1931,7 @@ These modes are optional and can be added selectively to `~/.emacs.d/post-init.e (use-package rust-mode :commands rust-mode - :mode ("\\.rs$" . rust-mode) + :mode ("\\.rs\\'" . rust-mode) :custom (rust-indent-offset 2)) From 03f6495901cefc3b20419c3455268fee52c9653e Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 3 Feb 2026 11:24:54 -0500 Subject: [PATCH 023/113] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 624f854..c53b589 100644 --- a/README.md +++ b/README.md @@ -1929,6 +1929,7 @@ These modes are optional and can be added selectively to `~/.emacs.d/post-init.e :commands haskell-mode :mode ("\\.hs\\'" . haskell-mode)) +;; Support for Rust (use-package rust-mode :commands rust-mode :mode ("\\.rs\\'" . rust-mode) From 83dbda7980b7e870693c51538aad7cd6ea2e4123 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 3 Feb 2026 11:27:40 -0500 Subject: [PATCH 024/113] Update README.md --- README.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c53b589..8880e29 100644 --- a/README.md +++ b/README.md @@ -1860,10 +1860,21 @@ These modes are optional and can be added selectively to `~/.emacs.d/post-init.e :commands (gitattributes-mode gitconfig-mode gitignore-mode) - :mode (("/.gitconfig\\'" . gitconfig-mode) - ("/.gitignore\\'" . gitignore-mode) - ("/.gitignore_global\\'" . gitignore-mode) - ("/.gitattributes\\'" . gitattributes-mode))) + :mode (("/\\.gitignore\\'" . gitignore-mode) + ("/info/exclude\\'" . gitignore-mode) + ("/git/ignore\\'" . gitignore-mode) + ("/.gitignore_global\\'" . gitignore-mode) ; jc-dotfiles + + ("/\\.gitconfig\\'" . gitconfig-mode) + ("/\\.git/config\\'" . gitconfig-mode) + ("/modules/.*/config\\'" . gitconfig-mode) + ("/git/config\\'" . gitconfig-mode) + ("/\\.gitmodules\\'" . gitconfig-mode) + ("/etc/gitconfig\\'" . gitconfig-mode) + + ("/\\.gitattributes\\'" . gitattributes-mode) + ("/info/attributes\\'" . gitattributes-mode) + ("/git/attributes\\'" . gitattributes-mode))) ;; Support for YAML files. ;; From 54acac9fc0c0c0846181347768371aa8cab5efa2 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 3 Feb 2026 11:35:00 -0500 Subject: [PATCH 025/113] Update README.md --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 8880e29..72a2dd5 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,7 @@ Please share your configuration. It could serve as inspiration for other users. - [Inhibit the mouse](#inhibit-the-mouse) - [A better Emacs *help* buffer](#a-better-emacs-help-buffer) - [Efficient jumps](#efficient-jumps) + - [Renaming and deleting files](#renaming-and-deleting-files) - [Enhancing the Elisp development experience](#enhancing-the-elisp-development-experience) - [Tree-sitter Integration (Better Syntax Highlighting)](#tree-sitter-integration-better-syntax-highlighting) - [Showing the tab-bar](#showing-the-tab-bar) @@ -1517,6 +1518,33 @@ To configure **avy**, add the following to `~/.emacs.d/post-init.el`: 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. +### Renaming and deleting files + +This [bufferfile.el](https://github.com/jamescherti/bufferfile.el) package provides helper functions to delete, rename, or copy buffer files: +- `bufferfile-rename`: Renames the file visited by the current buffer, ensures that the destination directory exists, and updates the buffer name for all associated buffers, including clones/indirect buffers. It also ensures that buffer-local features referencing the file, such as Eglot or dired buffers, are correctly updated to reflect the new file name. +- `bufferfile-delete`: Delete the file associated with a buffer and kill all buffers visiting the file, including clones/indirect buffers. +- `bufferfile-copy`: Ensures that the destination directory exists and copies the file visited by the current buffer to a new file. + +The functions above also ensures that any modified buffers are saved prior to executing operations like renaming, deleting, or copying. + +To configure **bufferfile**, add the following to `~/.emacs.d/post-init.el`: +```elisp +(use-package bufferfile + :ensure t + :commands (bufferfile-copy + bufferfile-rename + bufferfile-delete) + :custom + ;; If non-nil, display messages during file renaming operations + (bufferfile-verbose nil) + + ;; If non-nil, enable using version control (VC) when available + (bufferfile-use-vc nil) + + ;; Specifies the action taken after deleting a file and killing its buffer. + (bufferfile-delete-switch-to 'parent-directory)) +``` + ### Enhancing the Elisp development experience To enhance the Elisp development experience, add the following to `~/.emacs.d/post-init.el`: From 382ef7dd5e048f95baa7bcd8fe465a2c92a16553 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 3 Feb 2026 11:37:40 -0500 Subject: [PATCH 026/113] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 72a2dd5..075b2b9 100644 --- a/README.md +++ b/README.md @@ -1545,6 +1545,12 @@ To configure **bufferfile**, add the following to `~/.emacs.d/post-init.el`: (bufferfile-delete-switch-to 'parent-directory)) ``` +The bufferfile package addresses the limitations of Emacs' built-in functions: +- Renaming: Indirect buffers point to the correct file path, but their buffer names become outdated. +- Deleting: Indirect buffers are not removed when the base buffer or another indirect buffer is deleted. + +**The bufferfile package addresses these issues** by ensuring that buffer names are updated when renaming a file and that all buffers, including indirect buffers, are deleted when a file is removed. + ### Enhancing the Elisp development experience To enhance the Elisp development experience, add the following to `~/.emacs.d/post-init.el`: From e3dc3799b0a086788272f79ef50b1f6fcd9dd802 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 3 Feb 2026 11:40:49 -0500 Subject: [PATCH 027/113] Update README.md --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 075b2b9..a32db7e 100644 --- a/README.md +++ b/README.md @@ -1545,11 +1545,12 @@ To configure **bufferfile**, add the following to `~/.emacs.d/post-init.el`: (bufferfile-delete-switch-to 'parent-directory)) ``` -The bufferfile package addresses the limitations of Emacs' built-in functions: -- Renaming: Indirect buffers point to the correct file path, but their buffer names become outdated. -- Deleting: Indirect buffers are not removed when the base buffer or another indirect buffer is deleted. +**The *bufferfile* package overcomes limitations in Emacs' built-in functions:** -**The bufferfile package addresses these issues** by ensuring that buffer names are updated when renaming a file and that all buffers, including indirect buffers, are deleted when a file is removed. +* **Emacs built-in renaming:** While indirect buffers continue to reference the correct file path, their buffer names can become outdated. +* **Emacs built-in deleting:** Indirect buffers are not automatically removed when the base buffer or another indirect buffer is deleted. + +**The bufferfile package resolves these issues** by updating buffer names when a file is renamed and removing all related buffers, including indirect ones, when a file is deleted. ### Enhancing the Elisp development experience From 75c6cbacc77ab991c326d17c8a1868509ba3e17a Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 3 Feb 2026 11:41:06 -0500 Subject: [PATCH 028/113] Update README.md --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index a32db7e..e65ec01 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,6 @@ [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) ![](https://jamescherti.com/misc/made-for-gnu-emacs.svg) -## Introduction - The **minimal-emacs.d** project is a lightweight and optimized Emacs base (`init.el` and `early-init.el`) that **gives you full control over your configuration** (without the complexity of, for instance, Doom Emacs or Spacemacs). It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup. Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive resing 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)) @@ -58,8 +56,7 @@ Please share your configuration. It could serve as inspiration for other users. ## Table of Contents - [*minimal-emacs.d* - A Customizable Emacs `init.el` and `early-init.el` that Provides Better Defaults and Faster Startup](#minimal-emacsd---a-customizable-emacs-initel-and-early-initel-that-provides-better-defaults-and-faster-startup) - - [Introduction](#introduction) - - [Startup](#startup) + - [-](#-) - [Comments from minimal-emacs.d users](#comments-from-minimal-emacsd-users) - [Install minimal-emacs.d](#install-minimal-emacsd) - [Install minimal-emacs.d into `~/.emacs.d`](#install-minimal-emacsd-into-emacsd) From 62c3b2231def673bcab5f9599729f63448bc621e Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 3 Feb 2026 11:47:25 -0500 Subject: [PATCH 029/113] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e65ec01..a32db7e 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) ![](https://jamescherti.com/misc/made-for-gnu-emacs.svg) +## Introduction + The **minimal-emacs.d** project is a lightweight and optimized Emacs base (`init.el` and `early-init.el`) that **gives you full control over your configuration** (without the complexity of, for instance, Doom Emacs or Spacemacs). It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup. Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive resing 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)) @@ -56,7 +58,8 @@ Please share your configuration. It could serve as inspiration for other users. ## Table of Contents - [*minimal-emacs.d* - A Customizable Emacs `init.el` and `early-init.el` that Provides Better Defaults and Faster Startup](#minimal-emacsd---a-customizable-emacs-initel-and-early-initel-that-provides-better-defaults-and-faster-startup) - - [-](#-) + - [Introduction](#introduction) + - [Startup](#startup) - [Comments from minimal-emacs.d users](#comments-from-minimal-emacsd-users) - [Install minimal-emacs.d](#install-minimal-emacsd) - [Install minimal-emacs.d into `~/.emacs.d`](#install-minimal-emacsd-into-emacsd) From 54cf6e513cbaa5b2565ab5eb10665a868a663be1 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 3 Feb 2026 11:47:51 -0500 Subject: [PATCH 030/113] Update README.md --- README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a32db7e..b1adc05 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,6 @@ [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) ![](https://jamescherti.com/misc/made-for-gnu-emacs.svg) -## Introduction - The **minimal-emacs.d** project is a lightweight and optimized Emacs base (`init.el` and `early-init.el`) that **gives you full control over your configuration** (without the complexity of, for instance, Doom Emacs or Spacemacs). It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup. Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive resing 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)) @@ -24,7 +22,7 @@ Emacs comes with many well-designed defaults, but it also retains some less-than ![](https://www.jamescherti.com/misc/screenshot-minimal-emacs-3.png) *(The theme shown in the screenshot above is the *[tomorrow-night-deepblue-theme.el](https://github.com/jamescherti/tomorrow-night-deepblue-theme.el)*, available on MELPA.)* -### Startup +## Startup The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongside **146 packages** ([See the packages that the author is using here](https://www.jamescherti.com/essential-emacs-packages/)). Yet, thanks to its efficient design, Emacs still **starts in just 0.22 seconds**: @@ -58,8 +56,7 @@ Please share your configuration. It could serve as inspiration for other users. ## Table of Contents - [*minimal-emacs.d* - A Customizable Emacs `init.el` and `early-init.el` that Provides Better Defaults and Faster Startup](#minimal-emacsd---a-customizable-emacs-initel-and-early-initel-that-provides-better-defaults-and-faster-startup) - - [Introduction](#introduction) - - [Startup](#startup) + - [Startup](#startup) - [Comments from minimal-emacs.d users](#comments-from-minimal-emacsd-users) - [Install minimal-emacs.d](#install-minimal-emacsd) - [Install minimal-emacs.d into `~/.emacs.d`](#install-minimal-emacsd-into-emacsd) From f5b212581ae58d6bda9bcf5ae137a91e8931c0e1 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 3 Feb 2026 13:17:30 -0500 Subject: [PATCH 031/113] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index b1adc05..89fc655 100644 --- a/README.md +++ b/README.md @@ -1927,6 +1927,11 @@ These modes are optional and can be added selectively to `~/.emacs.d/post-init.e :commands dockerfile-mode :mode ("Dockerfile\\'" . dockerfile-mode)) +;; Support for Gnuplot files +(use-package gnuplot + :commands (gnuplot-mode) + :mode ("\\.gp\\'" . gnuplot-mode)) + ;; Support for *.lua files. ;; ;; Prefer the tree-sitter-based lua-ts-mode over lua-mode when available, as it From ae1106ae5947f0235a70620d76fae536e4e54a34 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 3 Feb 2026 13:17:37 -0500 Subject: [PATCH 032/113] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 89fc655..6e21bb4 100644 --- a/README.md +++ b/README.md @@ -1929,7 +1929,7 @@ These modes are optional and can be added selectively to `~/.emacs.d/post-init.e ;; Support for Gnuplot files (use-package gnuplot - :commands (gnuplot-mode) + :commands gnuplot-mode :mode ("\\.gp\\'" . gnuplot-mode)) ;; Support for *.lua files. From abecef885586ea904243f6db0dd54f5a22f952c2 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 3 Feb 2026 13:41:26 -0500 Subject: [PATCH 033/113] Update README.md --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index 6e21bb4..23a20b4 100644 --- a/README.md +++ b/README.md @@ -2005,12 +2005,6 @@ These modes are optional and can be added selectively to `~/.emacs.d/post-init.e :commands nix-mode :mode ("\\.nix\\'" . nix-mode)) -;; Support for common .env file syntax, typically used for environment -;; variable files -(use-package dotenv-mode - :commands dotenv-mode - :mode ("\\.env\\..*\\'" . dotenv-mode)) - ;; Major mode for editing Fish shell scripts (use-package fish-mode :commands fish-mode From 70b487b62b65866a620e86cd10e701f3aa08b9cc Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 10 Feb 2026 10:47:34 -0500 Subject: [PATCH 034/113] Update README.md --- README.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 23a20b4..c875f35 100644 --- a/README.md +++ b/README.md @@ -897,12 +897,21 @@ To configure **easysession**, add the following to `~/.emacs.d/post-init.el`: (global-set-key (kbd "C-c sR") #'easysession-reset) (global-set-key (kbd "C-c sd") #'easysession-delete) - ;; The depth 102 and 103 have been added to to `add-hook' to ensure that the - ;; session is loaded after all other packages. (Using 103/102 is particularly - ;; useful for those using minimal-emacs.d, where some optimizations restore - ;; `file-name-handler-alist` at depth 101 during `emacs-startup-hook`.) - (add-hook 'emacs-startup-hook #'easysession-load-including-geometry 102) - (add-hook 'emacs-startup-hook #'easysession-save-mode 103)) + (if (fboundp 'easysession-setup) + ;; The `easysession-setup' function adds hooks: + ;; - To enable automatic session loading during `emacs-startup-hook', or + ;; `server-after-make-frame-hook' when running in daemon mode. + ;; - To automatically save the session at regular intervals, and when + ;; Emacs exits. + (easysession-setup) + ;; Legacy + ;; The depth 102 and 103 have been added to to `add-hook' to ensure that the + ;; session is loaded after all other packages. (Using 103/102 is + ;; particularly useful for those using minimal-emacs.d, where some + ;; optimizations restore `file-name-handler-alist` at depth 101 during + ;; `emacs-startup-hook`.) + (add-hook 'emacs-startup-hook #'easysession-load-including-geometry 102) + (add-hook 'emacs-startup-hook #'easysession-save-mode 103))) ``` ### Configuring markdown-mode (e.g., README.md syntax) From 59b77366b5af0b8db6a3ef5aa4cffb40a9987bda Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 11 Feb 2026 10:48:00 -0500 Subject: [PATCH 035/113] Update README.md --- README.md | 141 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 113 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index c875f35..b950bb3 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid ![](https://www.jamescherti.com/wp-content/uploads/minimal-emacs-startup-time.png) -In addition to *minimal-emacs.d*, startup speed is influenced by your computer's processing power and disk speed. To establish a baseline, start Emacs with only *minimal-emacs.d* and no additional configurations, then run `M-x emacs-init-time`. Incrementally modify your init files and observe the impact on startup time. For consistent comparisons, always test on the same computer and Emacs version. It's also important to ensure that all packages are deferred using `:defer t` and `:commands`, which makes Emacs load them only when needed (see additional examples in this README.md). While startup time is important, other factors, like native compilation, are even more important. Although native compilation may introduce some brief initial and negligible initial delay, it is beneficial in the long run as it significantly speeds up Emacs. +In addition to *minimal-emacs.d*, startup speed is influenced by your computer's processing power and disk speed. To establish a baseline, start Emacs with only *minimal-emacs.d* and no additional configurations, then run `M-x emacs-init-time`. Incrementally modify your init files and observe the impact on startup time. For consistent comparisons, always test on the same computer and Emacs version. It's also important to ensure that all packages are deferred using `:bind` and `:commands`, which makes Emacs load them only when needed (see additional examples in this README.md). While startup time is important, other factors, like native compilation, are even more important. Although native compilation may introduce some brief initial and negligible initial delay, it is beneficial in the long run as it significantly speeds up Emacs. ## Comments from minimal-emacs.d users @@ -76,6 +76,10 @@ Please share your configuration. It could serve as inspiration for other users. - [Code completion with corfu](#code-completion-with-corfu) - [Configuring Vertico, Consult, and Embark](#configuring-vertico-consult-and-embark) - [Code folding](#code-folding) + - [Kirigami: A unified interface for opening and closing folds](#kirigami-a-unified-interface-for-opening-and-closing-folds) + - [outline-minor-mode and hs-minor-mode](#outline-minor-mode-and-hs-minor-mode) + - [outline-indent-minor-mode: Folding based on indentation levels](#outline-indent-minor-mode-folding-based-on-indentation-levels) + - [treesit-fold](#treesit-fold) - [Enhancing undo/redo](#enhancing-undoredo) - [Changing the default theme](#changing-the-default-theme) - [Configuring Vim keybindings using Evil?](#configuring-vim-keybindings-using-evil) @@ -92,11 +96,11 @@ Please share your configuration. It could serve as inspiration for other users. - [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) - [A better Emacs *help* buffer](#a-better-emacs-help-buffer) - [Efficient jumps](#efficient-jumps) - [Renaming and deleting files](#renaming-and-deleting-files) - [Enhancing the Elisp development experience](#enhancing-the-elisp-development-experience) + - [Inhibiting the mouse](#inhibiting-the-mouse) - [Tree-sitter Integration (Better Syntax Highlighting)](#tree-sitter-integration-better-syntax-highlighting) - [Showing the tab-bar](#showing-the-tab-bar) - [Offline Dictionary](#offline-dictionary) @@ -613,7 +617,47 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E ### Code folding -The built-in `outline-minor-mode` provides structured code folding in modes such as Emacs Lisp and Python, allowing users to collapse and expand sections based on headings or indentation levels. This feature enhances navigation and improves the management of large files with hierarchical structures. +#### Kirigami: A unified interface for opening and closing folds + +The [kirigami](https://github.com/jamescherti/kirigami.el) package offers a **unified interface for opening and closing folds** across a diverse set of major and minor modes in Emacs, including `outline-mode`, `outline-minor-mode`, `outline-indent-mode`, `org-mode`, `markdown-mode`, `gfm-mode`, `vdiff-mode`, `vdiff-3way-mode`, `hs-minor-mode`, `hide-ifdef-mode`, `origami-mode`, `yafolding-mode`, `folding-mode`, and `treesit-fold-mode`. +```elisp +(lightemacs-use-package kirigami + :commands (kirigami-open-fold + kirigami-open-fold-rec + kirigami-close-fold + kirigami-toggle-fold + kirigami-open-folds + kirigami-close-folds-except-current + kirigami-close-folds) + + :init + (global-set-key (kbd "C-c k o") 'kirigami-open-fold) ; Open fold at point + (global-set-key (kbd "C-c k c") 'kirigami-close-fold) ; Close fold at point + (global-set-key (kbd "C-c k m") 'kirigami-close-folds) ; Close all folds + (global-set-key (kbd "C-c k r") 'kirigami-open-folds) ; Open all folds + (global-set-key (kbd "C-c k O") 'kirigami-open-fold-rec) ; Open fold recursively + (global-set-key (kbd "C-c k TAB") 'kirigami-toggle-fold)) ; Toggle fold at point + +;; Uncomment the following if you are an `evil-mode' user: +;; (with-eval-after-load 'evil +;; (define-key evil-normal-state-map "zo" 'kirigami-open-fold) +;; (define-key evil-normal-state-map "zO" 'kirigami-open-fold-rec) +;; (define-key evil-normal-state-map "zc" 'kirigami-close-fold) +;; (define-key evil-normal-state-map "za" 'kirigami-toggle-fold) +;; (define-key evil-normal-state-map "zr" 'kirigami-open-folds) +;; (define-key evil-normal-state-map "zm" 'kirigami-close-folds)) +``` + +With Kirigami, folding key bindings only need to be configured **once**. After that, the same keys work consistently across all supported major and minor modes, providing a unified and predictable experience for opening and closing folds. + +In addition to unified interface for opening and closing folds, the **kirigami** package: +- **Enhances Visual Stability on Fold Opening and Closing:** Preserves the cursor's exact vertical position when expanding or collapsing headings, maintaining a constant relative distance between the cursor and the window start. This Kirigami enhancement avoids the disruptive window jump or forced re-centering commonly observed during bulk folding operations. +- **Enhances outline:** Kirigami improves folding behavior in `outline-mode`, `outline-minor-mode`, `markdown-mode`, `gfm-mode`, and `org-mode`. It ensures that deep folds open reliably and permits closing folds even when the cursor is positioned within the content body. Additionally, it maintains window-start heading stability by automatically adjusting the scroll position to keep folded headings visible, preventing the context from disappearing when closing a fold that is partially scrolled off-screen. +- **Hooks for Folding Actions:** Two hooks, `kirigami-pre-action-predicates` and `kirigami-post-action-functions`, let external code run before and after every folding operation. The pre-action hook runs just before a fold is opened or closed and can allow or block the action. The post-action hook runs once the change is complete and can be used to update UI elements or keep external packages in sync with the new folding state. + +#### outline-minor-mode and hs-minor-mode + +One of the modes that provide code folding is `outline-minor-mode` provides structured code folding in modes such as Emacs Lisp and Python, allowing users to collapse and expand sections based on headings or indentation levels. This feature enhances navigation and improves the management of large files with hierarchical structures. Alternatively, `hs-minor-mode` offers basic code folding for blocks defined by curly braces, functions, or other language-specific delimiters. However, for more flexible folding that supports multiple nested levels, `outline-minor-mode` is generally the preferred choice, as it enables finer control over section visibility in deeply structured code. @@ -641,6 +685,8 @@ For example, to enable `outline-minor-mode` in Emacs Lisp: (setq buffer-display-table display-table)))))) ``` +#### outline-indent-minor-mode: Folding based on indentation levels + For folding based on indentation levels, the **[outline-indent](https://github.com/jamescherti/outline-indent.el)** Emacs package provides a minor mode that enables folding according to the indentation structure: ```elisp ;; The outline-indent Emacs package provides a minor mode that enables code @@ -670,6 +716,45 @@ For folding based on indentation levels, the **[outline-indent](https://github.c ![](https://raw.githubusercontent.com/jamescherti/outline-indent.el/main/.images/screenshot2.png) +#### treesit-fold + +It is also recommended to install [treesit-fold](https://github.com/emacs-tree-sitter/treesit-fold), which provides intelligent code folding by leveraging the structural understanding of the built-in tree-sitter parser. Unlike traditional folding methods that rely on regular expressions or indentation, treesit-fold uses the actual syntax tree of the code to accurately identify foldable regions such as functions, classes, comments, and documentation strings. This allows for faster and more precise folding behavior that respects the grammar of the programming language, ensuring that fold boundaries are always syntactically correct even in complex or nested code structures. +```elisp +;; Intelligent code folding by leveraging the structural understanding of the +;; built-in tree-sitter parser. Unlike traditional folding methods that rely on +;; regular expressions or indentation, treesit-fold uses the actual syntax tree +;; of the code to accurately identify foldable regions such as functions, +;; classes, comments, and documentation strings. This allows for faster and more +;; precise folding behavior that respects the grammar of the programming +;; language, ensuring that fold boundaries are always syntactically correct even +;; in complex or nested code structures. +(use-package treesit-fold + :commands (treesit-fold-close + treesit-fold-close-all + treesit-fold-open + treesit-fold-toggle + treesit-fold-open-all + treesit-fold-mode + global-treesit-fold-mode + treesit-fold-open-recursively + treesit-fold-line-comment-mode) + + :custom + (treesit-fold-line-count-show t) + (treesit-fold-line-count-format " ▼") + + :config + (set-face-attribute 'treesit-fold-replacement-face nil + :foreground "#808080" + :box nil + :weight 'bold)) +``` + +The `treesit-fold` mode can be enabled using `treesit-fold-mode` or a hook such as: +```elisp +(add-hook 'python-ts-mode-hook #'treesit-fold-mode) +``` + ### Enhancing undo/redo 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. @@ -1454,31 +1539,6 @@ To configure **treemacs**, add the following to `~/.emacs.d/post-init.el`: ;; (treemacs-start-on-boot) ``` -### Inhibit the mouse - -The [inhibit-mouse](https://github.com/jamescherti/inhibit-mouse.el) package disables mouse input in Emacs. - -This package is useful for users who want to disable the mouse to: -- Prevent accidental clicks or cursor movements that may unexpectedly change the cursor position. -- Reinforce a keyboard-centric workflow by discouraging reliance on the mouse for navigation. - -To configure **inhibit-mouse**, add the following to `~/.emacs.d/post-init.el`: -```emacs-lisp -;; This package is useful for users who want to disable the mouse to: -;; - Prevent accidental clicks or cursor movements that may unexpectedly change -;; the cursor position. -;; - Reinforce a keyboard-centric workflow by discouraging reliance on the mouse -;; for navigation. -(use-package inhibit-mouse - :ensure t - :config - (if (daemonp) - (add-hook 'server-after-make-frame-hook #'inhibit-mouse-mode) - (inhibit-mouse-mode 1))) -``` - -NOTE: `inhibit-mouse-mode` allows users to disable and re-enable mouse functionality, giving them the flexibility to use the mouse when needed. - ### A better Emacs *help* buffer [Helpful](https://github.com/Wilfred/helpful) is an alternative to the built-in Emacs help that provides much more contextual information. @@ -1615,6 +1675,31 @@ Other optional packages that may be useful include: elisp-refs-symbol)) ``` +### Inhibiting the mouse + +The [inhibit-mouse](https://github.com/jamescherti/inhibit-mouse.el) package disables mouse input in Emacs. + +This package is useful for users who want to disable the mouse to: +- Prevent accidental clicks or cursor movements that may unexpectedly change the cursor position. +- Reinforce a keyboard-centric workflow by discouraging reliance on the mouse for navigation. + +To configure **inhibit-mouse**, add the following to `~/.emacs.d/post-init.el`: +```emacs-lisp +;; This package is useful for users who want to disable the mouse to: +;; - Prevent accidental clicks or cursor movements that may unexpectedly change +;; the cursor position. +;; - Reinforce a keyboard-centric workflow by discouraging reliance on the mouse +;; for navigation. +(use-package inhibit-mouse + :ensure t + :config + (if (daemonp) + (add-hook 'server-after-make-frame-hook #'inhibit-mouse-mode) + (inhibit-mouse-mode 1))) +``` + +NOTE: `inhibit-mouse-mode` allows users to disable and re-enable mouse functionality, giving them the flexibility to use the mouse when needed. + ### 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 00ac669d9c58630e6957941104f744881cad1f21 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Thu, 12 Feb 2026 12:55:48 -0500 Subject: [PATCH 036/113] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b950bb3..c412d6c 100644 --- a/README.md +++ b/README.md @@ -619,7 +619,7 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E #### Kirigami: A unified interface for opening and closing folds -The [kirigami](https://github.com/jamescherti/kirigami.el) package offers a **unified interface for opening and closing folds** across a diverse set of major and minor modes in Emacs, including `outline-mode`, `outline-minor-mode`, `outline-indent-mode`, `org-mode`, `markdown-mode`, `gfm-mode`, `vdiff-mode`, `vdiff-3way-mode`, `hs-minor-mode`, `hide-ifdef-mode`, `origami-mode`, `yafolding-mode`, `folding-mode`, and `treesit-fold-mode`. +The [kirigami](https://github.com/jamescherti/kirigami.el) package offers a **unified interface for opening and closing folds** across a diverse set of major and minor modes in Emacs, including `outline-mode`, `outline-minor-mode`, `outline-indent-minor-mode`, `org-mode`, `markdown-mode`, `gfm-mode`, `vdiff-mode`, `vdiff-3way-mode`, `hs-minor-mode`, `hide-ifdef-mode`, `origami-mode`, `yafolding-mode`, `folding-mode`, and `treesit-fold-mode`. ```elisp (lightemacs-use-package kirigami :commands (kirigami-open-fold @@ -2637,4 +2637,4 @@ Other Emacs packages by the same author: - [stripspace.el](https://github.com/jamescherti/stripspace.el): Ensure Emacs Automatically removes trailing whitespace before saving a buffer, with an option to preserve the cursor column. - [persist-text-scale.el](https://github.com/jamescherti/persist-text-scale.el): Ensure that all adjustments made with text-scale-increase and text-scale-decrease are persisted and restored across sessions. - [pathaction.el](https://github.com/jamescherti/pathaction.el): Execute the pathaction command-line tool from Emacs. The pathaction command-line tool enables the execution of specific commands on targeted files or directories. Its key advantage lies in its flexibility, allowing users to handle various types of files simply by passing the file or directory as an argument to the pathaction tool. The tool uses a .pathaction.yaml rule-set file to determine which command to execute. Additionally, Jinja2 templating can be employed in the rule-set file to further customize the commands. -- [kirigami.el](https://github.com/jamescherti/kirigami.el): The *kirigami* Emacs package offers a unified interface for opening and closing folds across a diverse set of major and minor modes in Emacs, including `outline-mode`, `outline-minor-mode`, `outline-indent-mode`, `org-mode`, `markdown-mode`, `vdiff-mode`, `vdiff-3way-mode`, `hs-minor-mode`, `hide-ifdef-mode`, `origami-mode`, `yafolding-mode`, `folding-mode`, and `treesit-fold-mode`. With Kirigami, folding key bindings only need to be configured **once**. After that, the same keys work consistently across all supported major and minor modes, providing a unified and predictable folding experience. +- [kirigami.el](https://github.com/jamescherti/kirigami.el): The *kirigami* Emacs package offers a unified interface for opening and closing folds across a diverse set of major and minor modes in Emacs, including `outline-mode`, `outline-minor-mode`, `outline-indent-minor-mode`, `org-mode`, `markdown-mode`, `vdiff-mode`, `vdiff-3way-mode`, `hs-minor-mode`, `hide-ifdef-mode`, `origami-mode`, `yafolding-mode`, `folding-mode`, and `treesit-fold-mode`. With Kirigami, folding key bindings only need to be configured **once**. After that, the same keys work consistently across all supported major and minor modes, providing a unified and predictable folding experience. From edf8b4562ac31440a5bb317a1441a8e470b1a0e9 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 15 Feb 2026 13:27:24 -0500 Subject: [PATCH 037/113] Remove kill-ring from savehist-additional-variables because certain characters cause savehist to fail. --- README.md | 44 ++++++++++++++++++++------------------------ init.el | 3 +-- 2 files changed, 21 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index c412d6c..2ed52f0 100644 --- a/README.md +++ b/README.md @@ -299,12 +299,12 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already :commands (auto-revert-mode global-auto-revert-mode) :hook (after-init . global-auto-revert-mode) - :custom - (auto-revert-interval 3) - (auto-revert-remote-files nil) - (auto-revert-use-notify t) - (auto-revert-avoid-polling nil) - (auto-revert-verbose t)) + :init + (setq auto-revert-interval 3) + (setq auto-revert-remote-files nil) + (setq auto-revert-use-notify t) + (setq auto-revert-avoid-polling nil) + (setq 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 @@ -315,15 +315,15 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already :hook (after-init . recentf-mode) - :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$")) + :init + (setq recentf-auto-cleanup (if (daemonp) 300 'never)) + (setq 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 @@ -341,13 +341,9 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already :commands (savehist-mode savehist-save) :hook (after-init . savehist-mode) - :custom - (savehist-autosave-interval 600) - (savehist-additional-variables - '(kill-ring ; clipboard - register-alist ; macros - mark-ring global-mark-ring ; marks - search-ring regexp-search-ring))) + :init + (setq history-length 300) + (setq 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 @@ -357,8 +353,8 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already :commands (save-place-mode save-place-local-mode) :hook (after-init . save-place-mode) - :custom - (save-place-limit 400)) + :init + (setq save-place-limit 400)) ``` ### Activating autosave diff --git a/init.el b/init.el index 5d601c5..01d9791 100644 --- a/init.el +++ b/init.el @@ -245,8 +245,7 @@ (setq history-length 300) (setq savehist-save-minibuffer-history t) ;; Default (setq savehist-additional-variables - '(kill-ring ; clipboard - register-alist ; macros + '(register-alist ; macros mark-ring global-mark-ring ; marks search-ring regexp-search-ring)) ; searches From 9b6d5484e139fd74193bd49c47243738572cfcf9 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 15 Feb 2026 15:13:19 -0500 Subject: [PATCH 038/113] Update header --- 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 8069e06..97664de 100644 --- a/early-init.el +++ b/early-init.el @@ -1,6 +1,6 @@ ;;; early-init.el --- Early Init -*- lexical-binding: t; -*- -;; Author: James Cherti +;; Author: James Cherti ;; URL: https://github.com/jamescherti/minimal-emacs.d ;; Package-Requires: ((emacs "29.1")) ;; Keywords: maint diff --git a/init.el b/init.el index 01d9791..67c12f0 100644 --- a/init.el +++ b/init.el @@ -1,6 +1,6 @@ ;;; init.el --- Init -*- lexical-binding: t; -*- -;; Author: James Cherti +;; Author: James Cherti ;; URL: https://github.com/jamescherti/minimal-emacs.d ;; Package-Requires: ((emacs "29.1")) ;; Keywords: maint From e01b29174bb2b87d19b6671d5442dc16839dd52e Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 16 Feb 2026 21:12:01 -0500 Subject: [PATCH 039/113] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ed52f0..0664745 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ The **minimal-emacs.d** project is a lightweight and optimized Emacs base (`init.el` and `early-init.el`) that **gives you full control over your configuration** (without the complexity of, for instance, Doom Emacs or Spacemacs). It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup. -Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive resing 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)) +Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs configuration. *(More information about the *minimal-emacs.d* features can be found here: [Features](#features).)* 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. From 46e3f2efde4bf13f08354c886d9d99b4ac5f1d0c Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 16 Feb 2026 21:45:49 -0500 Subject: [PATCH 040/113] Update README.md --- README.md | 50 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 0664745..7873611 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,31 @@ -# *minimal-emacs.d* - A Customizable Emacs `init.el` and `early-init.el` that Provides Better Defaults and Faster Startup +# *minimal-emacs.d* - A Customizable Emacs `init.el` and `early-init.el` for Better Defaults and Optimized Startup ![Build Status](https://github.com/jamescherti/minimal-emacs.d/actions/workflows/ci.yml/badge.svg) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) ![](https://jamescherti.com/misc/made-for-gnu-emacs.svg) -The **minimal-emacs.d** project is a lightweight and optimized Emacs base (`init.el` and `early-init.el`) that **gives you full control over your configuration** (without the complexity of, for instance, Doom Emacs or Spacemacs). It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup. +## Introduction + +The **minimal-emacs.d** project is a lightweight and optimized Emacs base (`init.el` and `early-init.el`) that **gives you full control over your configuration** without the complexity of Doom Emacs or Spacemacs. It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup. Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs configuration. *(More information about the *minimal-emacs.d* features can be found here: [Features](#features).)* +If this helps your workflow, please show your support by **⭐ starring minimal-emacs.d on GitHub** to help more Emacs users discover its benefits. + +### Looking for the ideal starter kit to customize Emacs? + +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, *minimal-emacs.d* does not impose modes or require packages. **You have full control** over which global or minor modes to enable. +* **Customizable foundation:** Designed to be extended, not replaced. This README offers extensive recommendations for customizing your configuration. + 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. -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. +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. You retain full control over which packages to install and which modes to enable. 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. @@ -22,15 +36,15 @@ Emacs comes with many well-designed defaults, but it also retains some less-than ![](https://www.jamescherti.com/misc/screenshot-minimal-emacs-3.png) *(The theme shown in the screenshot above is the *[tomorrow-night-deepblue-theme.el](https://github.com/jamescherti/tomorrow-night-deepblue-theme.el)*, available on MELPA.)* -## Startup +### Startup Performance The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongside **146 packages** ([See the packages that the author is using here](https://www.jamescherti.com/essential-emacs-packages/)). Yet, thanks to its efficient design, Emacs still **starts in just 0.22 seconds**: ![](https://www.jamescherti.com/wp-content/uploads/minimal-emacs-startup-time.png) -In addition to *minimal-emacs.d*, startup speed is influenced by your computer's processing power and disk speed. To establish a baseline, start Emacs with only *minimal-emacs.d* and no additional configurations, then run `M-x emacs-init-time`. Incrementally modify your init files and observe the impact on startup time. For consistent comparisons, always test on the same computer and Emacs version. It's also important to ensure that all packages are deferred using `:bind` and `:commands`, which makes Emacs load them only when needed (see additional examples in this README.md). While startup time is important, other factors, like native compilation, are even more important. Although native compilation may introduce some brief initial and negligible initial delay, it is beneficial in the long run as it significantly speeds up Emacs. +Startup speed depends on hardware and disk speed. For consistent comparisons, test on the same computer and Emacs version. While startup time is significant, factors like native compilation are also important for long-term performance. -## Comments from minimal-emacs.d users +## User Testimonials - [gnudoc on Reddit](https://www.reddit.com/r/emacs/comments/1feaf37/comment/lmn1hoo/): "That's a great learning resource. Thank you for your work on it and for sharing it!" - [dewyke on Reddit](https://www.reddit.com/r/emacs/comments/1feaf37/comment/lmq53an/): "Lots of good stuff in there, even for people who already have established ways of organising their configs." @@ -55,9 +69,11 @@ Please share your configuration. It could serve as inspiration for other users. ## Table of Contents -- [*minimal-emacs.d* - A Customizable Emacs `init.el` and `early-init.el` that Provides Better Defaults and Faster Startup](#minimal-emacsd---a-customizable-emacs-initel-and-early-initel-that-provides-better-defaults-and-faster-startup) - - [Startup](#startup) - - [Comments from minimal-emacs.d users](#comments-from-minimal-emacsd-users) +- [*minimal-emacs.d* - A Customizable Emacs `init.el` and `early-init.el` for Better Defaults and Optimized Startup](#minimal-emacsd---a-customizable-emacs-initel-and-early-initel-for-better-defaults-and-optimized-startup) + - [Introduction](#introduction) + - [Looking for the ideal starter kit to customize Emacs?](#looking-for-the-ideal-starter-kit-to-customize-emacs) + - [Startup Performance](#startup-performance) + - [User Testimonials](#user-testimonials) - [Install minimal-emacs.d](#install-minimal-emacsd) - [Install minimal-emacs.d into `~/.emacs.d`](#install-minimal-emacsd-into-emacsd) - [Alternative: Install minimal-emacs.d into `~/.minimal-emacs.d`](#alternative-install-minimal-emacsd-into-minimal-emacsd) @@ -69,12 +85,12 @@ Please share your configuration. It could serve as inspiration for other users. - [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) - - [Activating autosave](#activating-autosave) + - [File Management & History: recentf, savehist, saveplace, and auto-revert?](#file-management--history-recentf-savehist-saveplace-and-auto-revert) + - [Safety: Auto-Save](#safety-auto-save) - [auto-save-mode (Prevent data loss in case of crashes)](#auto-save-mode-prevent-data-loss-in-case-of-crashes) - [auto-save-visited-mode (Save file buffers after a few seconds of inactivity)](#auto-save-visited-mode-save-file-buffers-after-a-few-seconds-of-inactivity) - - [Code completion with corfu](#code-completion-with-corfu) - - [Configuring Vertico, Consult, and Embark](#configuring-vertico-consult-and-embark) + - [Completion System (Corfu, Vertico, Consult)](#completion-system-corfu-vertico-consult) + - [Vertico, Consult, Marginalia, and Embark](#vertico-consult-marginalia-and-embark) - [Code folding](#code-folding) - [Kirigami: A unified interface for opening and closing folds](#kirigami-a-unified-interface-for-opening-and-closing-folds) - [outline-minor-mode and hs-minor-mode](#outline-minor-mode-and-hs-minor-mode) @@ -287,7 +303,7 @@ Native compilation enhances Emacs performance by converting Elisp code into nati (compile-angel-on-load-mode 1)) ``` -### How to activate recentf, savehist, saveplace, and auto-revert? +### File Management & History: recentf, savehist, saveplace, and auto-revert? The recentf, savehist, saveplace, and auto-revert built-in packages are already configured by *minimal-emacs.d*. All you need to do is activate them by adding the following to `~/.emacs.d/post-init.el`: ``` emacs-lisp @@ -357,7 +373,7 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already (setq save-place-limit 400)) ``` -### Activating autosave +### Safety: Auto-Save #### auto-save-mode (Prevent data loss in case of crashes) @@ -394,7 +410,7 @@ This is different from `auto-save-mode`: `auto-save-mode` periodically saves all (auto-save-visited-mode 1) ``` -### Code completion with corfu +### Completion System (Corfu, Vertico, Consult) [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. @@ -441,7 +457,7 @@ To configure `corfu` and `cape`, add the following to `~/.emacs.d/post-init.el`: (add-hook 'completion-at-point-functions #'cape-elisp-block)) ``` -### Configuring Vertico, Consult, and Embark +### Vertico, Consult, Marginalia, and Embark [Vertico](https://github.com/minad/vertico), [Consult](https://github.com/minad/consult), and [Embark](https://github.com/oantolin/embark) collectively enhance Emacs' completion and navigation capabilities. From 57e106b6c5e7aeb6536a49a100b9a5dddc138fe2 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 16 Feb 2026 22:33:33 -0500 Subject: [PATCH 041/113] Update README.md --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 7873611..32ec7f5 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,7 @@ Please share your configuration. It could serve as inspiration for other users. - [Frequently asked questions](#frequently-asked-questions) - [Customizing Scroll Recentering](#customizing-scroll-recentering) - [How to display Emacs startup duration?](#how-to-display-emacs-startup-duration) + - [Optimization: Disable site-run-file (System-Wide Initialization)](#optimization-disable-site-run-file-system-wide-initialization) - [How to get the latest version of all packages? (unstable)](#how-to-get-the-latest-version-of-all-packages-unstable) - [How to use MELPA stable?](#how-to-use-melpa-stable) - [How to load a local lisp file for machine-specific configurations?](#how-to-load-a-local-lisp-file-for-machine-specific-configurations) @@ -2266,6 +2267,22 @@ Add the following to your `~/.emacs.d/pre-early-init.el` file: (Alternatively, you may use the built-in `M-x emacs-init-time` command to obtain the startup duration. However, `emacs-init-time` does not account for the portion of the startup process that occurs after `after-init-time`.) +### Optimization: Disable site-run-file (System-Wide Initialization) + +By default, Emacs loads the `site-start.el` file during the startup sequence. This file is typically managed by the operating system or system administrators to apply global settings, such as Linux distribution-specific packages or environment paths. + +Loading the `site-start.el` file presents two specific drawbacks for a minimal configuration: it degrades performance by adding unnecessary I/O and evaluation time during the early startup phase, and it compromises reproducibility by injecting external configuration variables that may conflict with your personal settings, causing the setup to behave differently across various environments. + +To guarantee a clean environment and eliminate this overhead, add the following to your `~/.emacs.d/pre-early-init.el`: + +```elisp +;; Prevent the loading of the system-wide site-start.el file +;; NOTE: This must be placed in 'pre-early-init.el'. +(setq site-run-file nil) +``` + +While `site-start.el` is optional on standard Linux distributions like Ubuntu, Fedora, and Arch, often loading only generic, superfluous settings, it is required on functional operating systems such as NixOS and Guix System. Since these systems isolate every package in a unique directory, the operating system uses `site-start.el` to inject the necessary `load-path` variables, without which Emacs cannot locate its own core dependencies. + ### How to get the latest version of all packages? (unstable) By default, *minimal-emacs.d* is configured to prioritize packages from [GNU ELPA](https://elpa.gnu.org/) and [NonGNU ELPA](https://elpa.nongnu.org/) repositories over [MELPA](https://melpa.org/), ensuring greater stability. From 5f083d5869d8fa56e0bf4eb2c1e7fec9aaa71dc4 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 16 Feb 2026 08:22:40 -0500 Subject: [PATCH 042/113] Add auth-sources and epg-pinentry-mode --- init.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/init.el b/init.el index 67c12f0..5883b03 100644 --- a/init.el +++ b/init.el @@ -117,6 +117,14 @@ (setq eval-expression-print-length nil eval-expression-print-level nil) +;; This directs gpg-agent to use the minibuffer for passphrase entry +(setq epg-pinentry-mode 'loopback) + +;; By default, Emacs stores sensitive authinfo credentials as unencrypted text +;; in your home directory. Use GPG to encrypt the authinfo file for enhanced +;; security. +(setq auth-sources (list "~/.authinfo.gpg")) + ;;; `display-line-numbers-mode' (setq-default display-line-numbers-width 3) From 18428dc7fc475ba3677f3ed32f824abbdcc084bc Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 16 Feb 2026 22:41:42 -0500 Subject: [PATCH 043/113] Add optimizations to README.md --- README.md | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 32ec7f5..e2b7496 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,9 @@ Please share your configuration. It could serve as inspiration for other users. - [Frequently asked questions](#frequently-asked-questions) - [Customizing Scroll Recentering](#customizing-scroll-recentering) - [How to display Emacs startup duration?](#how-to-display-emacs-startup-duration) - - [Optimization: Disable site-run-file (System-Wide Initialization)](#optimization-disable-site-run-file-system-wide-initialization) + - [Optimization: Disabling site-run-file (System-Wide Initialization) and inhibit-default-init](#optimization-disabling-site-run-file-system-wide-initialization-and-inhibit-default-init) + - [Optimization: Disable `site-run-file`](#optimization-disable-site-run-file) + - [Optimization: Disable `default.el` (`inhibit-default-init`)](#optimization-disable-defaultel-inhibit-default-init) - [How to get the latest version of all packages? (unstable)](#how-to-get-the-latest-version-of-all-packages-unstable) - [How to use MELPA stable?](#how-to-use-melpa-stable) - [How to load a local lisp file for machine-specific configurations?](#how-to-load-a-local-lisp-file-for-machine-specific-configurations) @@ -2267,7 +2269,14 @@ Add the following to your `~/.emacs.d/pre-early-init.el` file: (Alternatively, you may use the built-in `M-x emacs-init-time` command to obtain the startup duration. However, `emacs-init-time` does not account for the portion of the startup process that occurs after `after-init-time`.) -### Optimization: Disable site-run-file (System-Wide Initialization) +### Optimization: Disabling site-run-file (System-Wide Initialization) and inhibit-default-init + +Emacs has a two-stage system initialization process: + +1. **`site-start.el` (Pre-Init):** Runs before your configuration. (Controlled by `site-run-file`). +2. **`default.el` (Post-Init):** Runs *after* your configuration. This is often used by distributions or sysadmins to provide "fallback" defaults or site-wide overrides that apply to all users. + +#### Optimization: Disable `site-run-file` By default, Emacs loads the `site-start.el` file during the startup sequence. This file is typically managed by the operating system or system administrators to apply global settings, such as Linux distribution-specific packages or environment paths. @@ -2283,6 +2292,21 @@ To guarantee a clean environment and eliminate this overhead, add the following While `site-start.el` is optional on standard Linux distributions like Ubuntu, Fedora, and Arch, often loading only generic, superfluous settings, it is required on functional operating systems such as NixOS and Guix System. Since these systems isolate every package in a unique directory, the operating system uses `site-start.el` to inject the necessary `load-path` variables, without which Emacs cannot locate its own core dependencies. +#### Optimization: Disable `default.el` (`inhibit-default-init`) + +While `site-run-file` prevents Emacs from loading system configuration **before** your init file, there is another variable that prevents Emacs from loading system configuration **after** your init file. + +Just like `site-start.el`, the `default.el` file can overwrite your carefully tuned settings and adds unnecessary I/O at startup. + +**To complete your system isolation, add this to your `pre-early-init.el`:** + +```elisp +;; Prevent loading of the system-wide default.el file +;; This ensures that no system configuration runs *after* your init file. +;; NOTE: This must be placed in 'pre-early-init.el'. +(setq inhibit-default-init t) +``` + ### How to get the latest version of all packages? (unstable) By default, *minimal-emacs.d* is configured to prioritize packages from [GNU ELPA](https://elpa.gnu.org/) and [NonGNU ELPA](https://elpa.nongnu.org/) repositories over [MELPA](https://melpa.org/), ensuring greater stability. From b5f07864bce2f40c16fcacdaa7a772a89b38ce1f Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 17 Feb 2026 12:00:43 -0500 Subject: [PATCH 044/113] Remove use-package-compute-statistics --- early-init.el | 1 - 1 file changed, 1 deletion(-) diff --git a/early-init.el b/early-init.el index 97664de..d72436a 100644 --- a/early-init.el +++ b/early-init.el @@ -466,7 +466,6 @@ this stage of initialization." ;; This results in a more compact output that emphasizes performance (setq use-package-expand-minimally (not noninteractive)) -(setq use-package-compute-statistics minimal-emacs-debug) (setq use-package-minimum-reported-time (if minimal-emacs-debug 0 0.1)) (setq use-package-verbose minimal-emacs-debug) (setq use-package-always-ensure t) From 8d538ea4316f11f4001804948f1f0cd4278b9d47 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 17 Feb 2026 13:31:36 -0500 Subject: [PATCH 045/113] Update README.md --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index e2b7496..a084a3f 100644 --- a/README.md +++ b/README.md @@ -2215,10 +2215,6 @@ And [add the Elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read (elpaca `(,@elpaca-order)) ;; Optional: Install use-package support -;; If you enable elpaca-use-package, some use-package definitions, such as -;; Vertico's, may need modifications. See the following discussion for details: -;; https://github.com/jamescherti/minimal-emacs.d/issues/54 -;; ;; (elpaca elpaca-use-package ;; (elpaca-use-package-mode)) ``` From ebecb8012d580619768faae5280fb7886161f771 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 17 Feb 2026 17:08:11 -0500 Subject: [PATCH 046/113] Update README.md --- README.md | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index a084a3f..2f76228 100644 --- a/README.md +++ b/README.md @@ -131,9 +131,9 @@ Please share your configuration. It could serve as inspiration for other users. - [Frequently asked questions](#frequently-asked-questions) - [Customizing Scroll Recentering](#customizing-scroll-recentering) - [How to display Emacs startup duration?](#how-to-display-emacs-startup-duration) - - [Optimization: Disabling site-run-file (System-Wide Initialization) and inhibit-default-init](#optimization-disabling-site-run-file-system-wide-initialization-and-inhibit-default-init) - - [Optimization: Disable `site-run-file`](#optimization-disable-site-run-file) - - [Optimization: Disable `default.el` (`inhibit-default-init`)](#optimization-disable-defaultel-inhibit-default-init) + - [Optimization: Disabling `site-run-file` and `inhibit-default-init`](#optimization-disabling-site-run-file-and-inhibit-default-init) + - [Disable `site-start.el` (Pre-Initialization Stage)](#disable-site-startel-pre-initialization-stage) + - [Disable `default.el` (Post-Initialization Stage)](#disable-defaultel-post-initialization-stage) - [How to get the latest version of all packages? (unstable)](#how-to-get-the-latest-version-of-all-packages-unstable) - [How to use MELPA stable?](#how-to-use-melpa-stable) - [How to load a local lisp file for machine-specific configurations?](#how-to-load-a-local-lisp-file-for-machine-specific-configurations) @@ -2265,44 +2265,46 @@ Add the following to your `~/.emacs.d/pre-early-init.el` file: (Alternatively, you may use the built-in `M-x emacs-init-time` command to obtain the startup duration. However, `emacs-init-time` does not account for the portion of the startup process that occurs after `after-init-time`.) -### Optimization: Disabling site-run-file (System-Wide Initialization) and inhibit-default-init +### Optimization: Disabling `site-run-file` and `inhibit-default-init` -Emacs has a two-stage system initialization process: +Emacs performs a multi-stage initialization sequence that may include system-level configuration before and after user configuration. For a minimal and fully deterministic setup, these stages can be disabled. -1. **`site-start.el` (Pre-Init):** Runs before your configuration. (Controlled by `site-run-file`). -2. **`default.el` (Post-Init):** Runs *after* your configuration. This is often used by distributions or sysadmins to provide "fallback" defaults or site-wide overrides that apply to all users. +Emacs can load two optional system-wide files: -#### Optimization: Disable `site-run-file` +1. **`site-start.el`**: Executed before the user configuration. Controlled by the variable `site-run-file`. +2. **`default.el`**: Executed after the user configuration. Controlled by the variable `inhibit-default-init`. -By default, Emacs loads the `site-start.el` file during the startup sequence. This file is typically managed by the operating system or system administrators to apply global settings, such as Linux distribution-specific packages or environment paths. +Both files are typically maintained by operating systems or system administrators to provide global defaults, package path adjustments, or distribution-specific behavior. -Loading the `site-start.el` file presents two specific drawbacks for a minimal configuration: it degrades performance by adding unnecessary I/O and evaluation time during the early startup phase, and it compromises reproducibility by injecting external configuration variables that may conflict with your personal settings, causing the setup to behave differently across various environments. +#### Disable `site-start.el` (Pre-Initialization Stage) -To guarantee a clean environment and eliminate this overhead, add the following to your `~/.emacs.d/pre-early-init.el`: +By default, Emacs evaluates `site-start.el` early in the startup process. While useful in managed environments, this introduces two disadvantages for a minimal configuration: + +* **Startup overhead**: Additional I/O and evaluation during the earliest phase of initialization. +* **Loss of determinism**: External configuration may modify variables, alter `load-path`, or introduce behavior that differs across machines. + +To ensure a clean and reproducible startup, disable this stage in `~/.emacs.d/pre-early-init.el`: ```elisp -;; Prevent the loading of the system-wide site-start.el file -;; NOTE: This must be placed in 'pre-early-init.el'. (setq site-run-file nil) ``` -While `site-start.el` is optional on standard Linux distributions like Ubuntu, Fedora, and Arch, often loading only generic, superfluous settings, it is required on functional operating systems such as NixOS and Guix System. Since these systems isolate every package in a unique directory, the operating system uses `site-start.el` to inject the necessary `load-path` variables, without which Emacs cannot locate its own core dependencies. +This guarantees that no system-level configuration executes before the user configuration. -#### Optimization: Disable `default.el` (`inhibit-default-init`) +Note: On conventional GNU/Linux distributions such as Ubuntu, Fedora, or Arch Linux, `site-start.el` is often optional and may only introduce distribution defaults. However, on functional systems such as NixOS or Guix System, it may be required to populate essential `load-path` entries. Disabling it in such environments can prevent Emacs from locating required libraries. -While `site-run-file` prevents Emacs from loading system configuration **before** your init file, there is another variable that prevents Emacs from loading system configuration **after** your init file. +#### Disable `default.el` (Post-Initialization Stage) -Just like `site-start.el`, the `default.el` file can overwrite your carefully tuned settings and adds unnecessary I/O at startup. +After loading the user configuration, Emacs may evaluate `default.el`. This file can override user-defined settings or introduce additional global behavior. -**To complete your system isolation, add this to your `pre-early-init.el`:** +To prevent any system configuration from executing after the user initialization, add the following to `pre-early-init.el`: ```elisp -;; Prevent loading of the system-wide default.el file -;; This ensures that no system configuration runs *after* your init file. -;; NOTE: This must be placed in 'pre-early-init.el'. (setq inhibit-default-init t) ``` +Disabling both `site-run-file` and `default.el` removes system-level interference, reduces startup variability, and establishes a fully controlled initialization environment suitable for minimal and reproducible configurations. + ### How to get the latest version of all packages? (unstable) By default, *minimal-emacs.d* is configured to prioritize packages from [GNU ELPA](https://elpa.gnu.org/) and [NonGNU ELPA](https://elpa.nongnu.org/) repositories over [MELPA](https://melpa.org/), ensuring greater stability. From fb18c40d9c826d7d0d8c2e141c347f77d202aafe Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 09:26:22 -0500 Subject: [PATCH 047/113] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2f76228..5a87b2e 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,14 @@ ## Introduction -The **minimal-emacs.d** project is a lightweight and optimized Emacs base (`init.el` and `early-init.el`) that **gives you full control over your configuration** without the complexity of Doom Emacs or Spacemacs. It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup. +The **minimal-emacs.d** project is a lightweight and optimized Emacs base (`init.el` and `early-init.el`) that **gives you full control over your configuration**. It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup. -Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs configuration. *(More information about the *minimal-emacs.d* features can be found here: [Features](#features).)* +In just a few minutes of applying what's in this README.md file, you will possess a fully functional, high-performance Emacs configuration ready for work. You will bypass hours of configuration and the heavy overhead of frameworks like Doom or Spacemacs, gaining immediate access to a foundation featuring optimized garbage collection, sensible UI defaults, and a fast startup. This is your fast track to a vanilla Emacs setup that remains lightweight, responsive, and entirely under your control. If this helps your workflow, please show your support by **⭐ starring minimal-emacs.d on GitHub** to help more Emacs users discover its benefits. +Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs configuration. *(More information about the *minimal-emacs.d* features can be found here: [Features](#features).)* + ### Looking for the ideal starter kit to customize Emacs? The *minimal-emacs.d* project is: From d87ed0ea4bcb51b08ed0ec09b14d97dacea6c2d2 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 09:27:47 -0500 Subject: [PATCH 048/113] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 5a87b2e..fabf8ef 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,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. +* **Better defaults:** Improved settings for usability, UI, garbage collection, and built-in packages. (Emacs comes with many well-designed defaults, but it also retains some less-than-ideal settings, often due to historical constraints or legacy compatibility.) * **0 packages loaded / No forced modes:** Unlike other frameworks, *minimal-emacs.d* does not impose modes or require packages. **You have full control** over which global or minor modes to enable. * **Customizable foundation:** Designed to be extended, not replaced. This README offers extensive recommendations for customizing your configuration. @@ -29,8 +29,6 @@ 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. You retain full control over which packages to install and which modes to enable. -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.)* ![](https://www.jamescherti.com/misc/screenshot-minimal-emacs-1.png) From 28960644990b87d98b42fb90c4e4302122c590f0 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 09:33:15 -0500 Subject: [PATCH 049/113] Update README.md --- README.md | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index fabf8ef..8990648 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,8 @@ Please share your configuration. It could serve as inspiration for other users. - [Alternative: Install minimal-emacs.d into `~/.minimal-emacs.d`](#alternative-install-minimal-emacsd-into-minimal-emacsd) - [Update minimal-emacs.d](#update-minimal-emacsd) - [Customizations: Never modify init.el and early-init.el. Modify these instead...](#customizations-never-modify-initel-and-early-initel-modify-these-instead) - - [Debug on error](#debug-on-error) + - [Recommendations](#recommendations) + - [Always defer package loading](#always-defer-package-loading) - [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) @@ -129,6 +130,7 @@ Please share your configuration. It could serve as inspiration for other users. - [Configuring straight.el](#configuring-straightel) - [Configuring Elpaca (package manager)](#configuring-elpaca-package-manager) - [Frequently asked questions](#frequently-asked-questions) + - [How to debug my configuration?](#how-to-debug-my-configuration) - [Customizing Scroll Recentering](#customizing-scroll-recentering) - [How to display Emacs startup duration?](#how-to-display-emacs-startup-duration) - [Optimization: Disabling `site-run-file` and `inhibit-default-init`](#optimization-disabling-site-run-file-and-inhibit-default-init) @@ -212,15 +214,13 @@ Replace `FILENAME.el` with the actual name and DESCRIPTION with a brief descript **Important:** The examples in this README reference pre/post init files in the `~/.emacs.d/` directory, but the files `pre-early-init.el`, `post-early-init.el`, `pre-init.el`, and `post-init.el` should be placed in the same directory as `init.el` and `early-init.el`, regardless of their location. -## Debug on error +## Recommendations -During the development of your init files, the author strongly recommends adding the following line at the very beginning of your `~/.emacs.d/pre-early-init.el` file: +### Always defer package loading -```elisp -(setq debug-on-error t) -``` +To ensure your configuration remains fast and responsive, always defer package loading so that libraries are initialized only when they are needed. The `use-package` macro makes this effortless; simply adding `:commands` or `:bind` to your package declarations automatically configures them for deferred loading. -Enabling `debug-on-error` at this stage allows you to catch errors that might otherwise cause Emacs to fail silently or behave unpredictably. +All `use-package` declarations in this README use deferred loading, so you can safely copy and paste them into your configuration. ## Customizations: UI (pre-early-init.el) @@ -2221,6 +2221,16 @@ And [add the Elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read ## Frequently asked questions +### How to debug my configuration? + +During the development of your init files, the author strongly recommends adding the following line at the very beginning of your `~/.emacs.d/pre-early-init.el` file: + +```elisp +(setq debug-on-error t) +``` + +Enabling `debug-on-error` at this stage allows you to catch errors that might otherwise cause Emacs to fail silently or behave unpredictably. + ### Customizing Scroll Recentering By default, minimal-emacs.d sets `scroll-conservatively` to `20`: From 99774caa179cc5657dc18c9a49736ec4094d6263 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 09:34:44 -0500 Subject: [PATCH 050/113] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8990648..ef9ae1a 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ If this helps your workflow, please show your support by **⭐ starring minimal- Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs configuration. *(More information about the *minimal-emacs.d* features can be found here: [Features](#features).)* +Ready? You can skip to: [Install minimal-emacs.d](#install-minimal-emacsd) + ### Looking for the ideal starter kit to customize Emacs? The *minimal-emacs.d* project is: From d3cdf9f2d58f3c41bc2776007f72842cb0b27614 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 09:35:08 -0500 Subject: [PATCH 051/113] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ef9ae1a..03cef3a 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ If this helps your workflow, please show your support by **⭐ starring minimal- Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs configuration. *(More information about the *minimal-emacs.d* features can be found here: [Features](#features).)* -Ready? You can skip to: [Install minimal-emacs.d](#install-minimal-emacsd) +**Getting Started: [Install minimal-emacs.d](#install-minimal-emacsd)** ### Looking for the ideal starter kit to customize Emacs? From e628bab4f13c0c1501b9694e8a57bc4f438c7748 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 09:35:34 -0500 Subject: [PATCH 052/113] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 03cef3a..9e4b5d9 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ If this helps your workflow, please show your support by **⭐ starring minimal- Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs configuration. *(More information about the *minimal-emacs.d* features can be found here: [Features](#features).)* -**Getting Started: [Install minimal-emacs.d](#install-minimal-emacsd)** +**Ready to start? [Install minimal-emacs.d](#install-minimal-emacsd)** ### Looking for the ideal starter kit to customize Emacs? From 125fab6e3c6a90fa93023090ca7f4903cf0dfe52 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 09:36:25 -0500 Subject: [PATCH 053/113] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9e4b5d9..c4492cf 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,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. +**Skip to: [Install minimal-emacs.d](#install-minimal-emacsd)** + 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. You retain full control over which packages to install and which modes to enable. ![](https://www.jamescherti.com/misc/screenshot-minimal-emacs-2.png) From c673ac4c747b81bb21d90ef5fab0e4a23dc62115 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 09:38:17 -0500 Subject: [PATCH 054/113] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c4492cf..f32d8ad 100644 --- a/README.md +++ b/README.md @@ -222,9 +222,9 @@ Replace `FILENAME.el` with the actual name and DESCRIPTION with a brief descript ### Always defer package loading -To ensure your configuration remains fast and responsive, always defer package loading so that libraries are initialized only when they are needed. The `use-package` macro makes this effortless; simply adding `:commands` or `:bind` to your package declarations automatically configures them for deferred loading. +**All `use-package` declarations in this README use deferred loading, so you can safely copy and paste them into your configuration.** -All `use-package` declarations in this README use deferred loading, so you can safely copy and paste them into your configuration. +To ensure your configuration remains fast and responsive, always defer package loading so that libraries are initialized only when they are needed. **The `use-package` macro makes this effortless; simply adding `:commands` or `:bind` to your package declarations automatically configures them for deferred loading.** ## Customizations: UI (pre-early-init.el) From 23656b840d79f3a8f6d1c56fce894c275c17f7ea Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 09:40:34 -0500 Subject: [PATCH 055/113] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f32d8ad..a3dbe6b 100644 --- a/README.md +++ b/README.md @@ -85,10 +85,10 @@ Please share your configuration. It could serve as inspiration for other users. - [Customizations: Never modify init.el and early-init.el. Modify these instead...](#customizations-never-modify-initel-and-early-initel-modify-these-instead) - [Recommendations](#recommendations) - [Always defer package loading](#always-defer-package-loading) - - [Customizations: UI (pre-early-init.el)](#customizations-ui-pre-early-initel) + - [Customizations: UI (File: pre-early-init.el)](#customizations-ui-file-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) + - [Customizations: Packages (File: post-init.el)](#customizations-packages-file-post-initel) - [Optimization: Native Compilation](#optimization-native-compilation) - [File Management & History: recentf, savehist, saveplace, and auto-revert?](#file-management--history-recentf-savehist-saveplace-and-auto-revert) - [Safety: Auto-Save](#safety-auto-save) @@ -130,7 +130,7 @@ Please share your configuration. It could serve as inspiration for other users. - [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) - [File types (Yaml, Dockerfile, Lua, Jinja2, CSV, Vimrc...)](#file-types-yaml-dockerfile-lua-jinja2-csv-vimrc) - - [Customizations: pre-early-init.el](#customizations-pre-early-initel) + - [Customizations: Before init (File: pre-init.el)](#customizations-before-init-file-pre-initel) - [Configuring straight.el](#configuring-straightel) - [Configuring Elpaca (package manager)](#configuring-elpaca-package-manager) - [Frequently asked questions](#frequently-asked-questions) @@ -226,7 +226,7 @@ Replace `FILENAME.el` with the actual name and DESCRIPTION with a brief descript To ensure your configuration remains fast and responsive, always defer package loading so that libraries are initialized only when they are needed. **The `use-package` macro makes this effortless; simply adding `:commands` or `:bind` to your package declarations automatically configures them for deferred loading.** -## Customizations: UI (pre-early-init.el) +## Customizations: UI (File: pre-early-init.el) ### How to enable the menu-bar, the tool-bar, dialogs, the contextual menu, and tooltips? @@ -256,7 +256,7 @@ An alternative lightweight approach is to simply change the default `~/.emacs.d` **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) +## Customizations: Packages (File: 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. @@ -2136,7 +2136,7 @@ These modes are optional and can be added selectively to `~/.emacs.d/post-init.e :mode ("Jenkinsfile\\'" . jenkinsfile-mode)) ``` -## Customizations: pre-early-init.el +## Customizations: Before init (File: pre-init.el) ### Configuring straight.el From 4061286da19cd59839c806df1ebd2417560820a3 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 09:41:24 -0500 Subject: [PATCH 056/113] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a3dbe6b..6f8a2a3 100644 --- a/README.md +++ b/README.md @@ -2138,6 +2138,8 @@ These modes are optional and can be added selectively to `~/.emacs.d/post-init.e ## Customizations: Before init (File: pre-init.el) +NOTE: Using `straight.el` or Elpaca is **optional**. Emacs already has a built-in package manager. + ### 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 649d2765dc2a5d6323e3182f3841056a1415f01d Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 09:22:43 -0500 Subject: [PATCH 057/113] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6f8a2a3..c40d758 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of * **Ready to start? [Install minimal-emacs.d](#install-minimal-emacsd)** +In just a few minutes of applying what's in this README.md file, you will possess a fully functional, high-performance Emacs configuration that is ready for work. By simply adopting **minimal-emacs.d**, you bypass hours of configuration and the heavy overhead of frameworks like Doom or Spacemacs. You gain immediate access to a professional-grade foundation featuring optimized garbage collection, sensible UI defaults, and a fast startup. This is your fast track to a vanilla Emacs setup that remains lightweight, responsive, and entirely under your control. + ### Looking for the ideal starter kit to customize Emacs? The *minimal-emacs.d* project is: From be191c7f1b74cf42875225fc5f78620d936429ed Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 09:23:31 -0500 Subject: [PATCH 058/113] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c40d758..e5ce61a 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,11 @@ In just a few minutes of applying what's in this README.md file, you will posses If this helps your workflow, please show your support by **⭐ starring minimal-emacs.d on GitHub** to help more Emacs users discover its benefits. -Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs configuration. *(More information about the *minimal-emacs.d* features can be found here: [Features](#features).)* +In just a few minutes of applying what's in this README.md file, you will possess a fully functional, high-performance Emacs configuration that is ready for work. By simply adopting **minimal-emacs.d**, you bypass hours of configuration and the heavy overhead of frameworks like Doom or Spacemacs. You gain immediate access to a professional-grade foundation featuring optimized garbage collection, sensible UI defaults, and a fast startup. This is your fast track to a vanilla Emacs setup that remains lightweight, responsive, and entirely under your control. **Ready to start? [Install minimal-emacs.d](#install-minimal-emacsd)** -In just a few minutes of applying what's in this README.md file, you will possess a fully functional, high-performance Emacs configuration that is ready for work. By simply adopting **minimal-emacs.d**, you bypass hours of configuration and the heavy overhead of frameworks like Doom or Spacemacs. You gain immediate access to a professional-grade foundation featuring optimized garbage collection, sensible UI defaults, and a fast startup. This is your fast track to a vanilla Emacs setup that remains lightweight, responsive, and entirely under your control. +Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs configuration. *(More information about the *minimal-emacs.d* features can be found here: [Features](#features).)* ### Looking for the ideal starter kit to customize Emacs? From 4044fd43a2db3ba39842cb7e44d08dc13a61e21a Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 10:01:27 -0500 Subject: [PATCH 059/113] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e5ce61a..06b9cb2 100644 --- a/README.md +++ b/README.md @@ -642,7 +642,7 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E The [kirigami](https://github.com/jamescherti/kirigami.el) package offers a **unified interface for opening and closing folds** across a diverse set of major and minor modes in Emacs, including `outline-mode`, `outline-minor-mode`, `outline-indent-minor-mode`, `org-mode`, `markdown-mode`, `gfm-mode`, `vdiff-mode`, `vdiff-3way-mode`, `hs-minor-mode`, `hide-ifdef-mode`, `origami-mode`, `yafolding-mode`, `folding-mode`, and `treesit-fold-mode`. ```elisp -(lightemacs-use-package kirigami +(use-package kirigami :commands (kirigami-open-fold kirigami-open-fold-rec kirigami-close-fold @@ -1095,7 +1095,7 @@ Unlike more sophisticated language-aware tools (e.g., eglot or lsp-mode), `dumb- To configure **dumb-jump**, add the following to `~/.emacs.d/post-init.el`: ```elisp -(lightemacs-use-package dumb-jump +(use-package dumb-jump :commands dumb-jump-xref-activate :init ;; Register `dumb-jump' as an xref backend so it integrates with From 856f73806ce47177857b68bb9ad13fb43ae91416 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 10:07:59 -0500 Subject: [PATCH 060/113] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 06b9cb2..f6373e2 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,6 @@ In just a few minutes of applying what's in this README.md file, you will posses If this helps your workflow, please show your support by **⭐ starring minimal-emacs.d on GitHub** to help more Emacs users discover its benefits. -In just a few minutes of applying what's in this README.md file, you will possess a fully functional, high-performance Emacs configuration that is ready for work. By simply adopting **minimal-emacs.d**, you bypass hours of configuration and the heavy overhead of frameworks like Doom or Spacemacs. You gain immediate access to a professional-grade foundation featuring optimized garbage collection, sensible UI defaults, and a fast startup. This is your fast track to a vanilla Emacs setup that remains lightweight, responsive, and entirely under your control. - **Ready to start? [Install minimal-emacs.d](#install-minimal-emacsd)** Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs configuration. *(More information about the *minimal-emacs.d* features can be found here: [Features](#features).)* @@ -270,7 +268,7 @@ Native compilation enhances Emacs performance by converting Elisp code into nati ```elisp (native-comp-available-p) ``` - (A non-nil result indicates that native compilation is active.) + (A non-nil result indicates that native compilation is available.) 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 From b1f4ba305c2b23c4619cd8238c61c1706aedeccc Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 10:14:10 -0500 Subject: [PATCH 061/113] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f6373e2..1f13cd1 100644 --- a/README.md +++ b/README.md @@ -1774,7 +1774,7 @@ Here are the main interactive functions: Prerequisite: -- The [sdcv](https://github.com/Dushistov/sdcv) command. (It can usually be installed by installing the `sdcv` package.) +- The [sdcv](https://github.com/Dushistov/sdcv) command. (On Linux systems, it can usually be installed by using the system's package manager to install the `sdcv` package.) - Download dictionaries from: http://download.huzheng.org/ . Once the dictionaries are downloaded, extract them into `/usr/share/stardict/dic/`, or configure the variable `quick-sdcv-dictionary-data-dir` in the Emacs configuration to specify an alternative dictionary path. ### Changing the Default Font From 7431b4efdd6ef75cbb0e57e42e23f14e473ab13f Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 10:18:52 -0500 Subject: [PATCH 062/113] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1f13cd1..7232b85 100644 --- a/README.md +++ b/README.md @@ -2581,6 +2581,8 @@ Keep in mind that if you change the `minimal-emacs-user-directory`, *minimal-ema ### How to make *minimal-emacs.d* install packages in the early-init phase instead of the init phase? +NOTE: Running package initialization and installation during the early-init phase is **NOT RECOMMENDED** because this stage occurs before the GUI system, windowing, and comprehensive error-handling buffers are fully initialized. When package-install or `package-refresh-contents` triggers a failure—such as a TLS handshake error or a lost network connection—Emacs cannot yet render a graphical window to display the backtrace or warning. This results in a "silent" hang or a crash that provides no visual feedback to the user, forcing a pivot to a terminal to inspect standard output. Furthermore, many packages expect a fully functional frame and loaded user environment to configure themselves correctly; forcing them to load during early-init bypasses the intentional separation designed to let you set up UI-independent variables before the package system and GUI logic complicate the startup sequence. + To install and load packages during the early-init phase, add the following to `post-early-init.el`: ```elisp From 480c8d606e54f69aebb472e3f39c034ed4f4d8ae Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 10:23:15 -0500 Subject: [PATCH 063/113] Update README.md --- README.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7232b85..11e0c25 100644 --- a/README.md +++ b/README.md @@ -2586,6 +2586,24 @@ NOTE: Running package initialization and installation during the early-init phas To install and load packages during the early-init phase, add the following to `post-early-init.el`: ```elisp +;; THIS IS NOT RECOMMENDED +;; +;; Running package initialization and installation during the early-init phase +;; is NOT RECOMMENDED because this stage occurs before the GUI system, +;; windowing, and comprehensive error-handling buffers are fully initialized. +;; When package-install or `package-refresh-contents` triggers a failure—such as +;; a TLS handshake error or a lost network connection—Emacs cannot yet render a +;; graphical window to display the backtrace or warning. This results in a +;; "silent" hang or a crash that provides no visual feedback to the user, +;; forcing a pivot to a terminal to inspect standard output. Furthermore, many +;; packages expect a fully functional frame and loaded user environment to +;; configure themselves correctly; forcing them to load during early-init +;; bypasses the intentional separation designed to let you set up UI-independent +;; variables before the package system and GUI logic complicate the startup +;; sequence. +;; +;; File: `post-early-init.el' + (setq minimal-emacs-package-initialize-and-refresh nil) ;; If you want to ignore the warning: @@ -2606,8 +2624,6 @@ To install and load packages during the early-init phase, add the following to ` ;; TODO: Add your use-package code here ``` -A drawback of using the early-init phase instead of init is that if a package fails (e.g, due to a network issue), no output will be displayed in the Emacs GUI. You will need to open a terminal to view Emacs's stdout for error messages. - ### Minimal-emacs.d configurations from users - [Victor Dorneanu's minimal-emacs.d configuration](https://github.com/dorneanu/dotfiles/blob/master/minimal-emacs/config.org) From 769c20aa59f0709ddd7bd9195b75b7430a60e01e Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 10:23:49 -0500 Subject: [PATCH 064/113] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 11e0c25..80b7c0d 100644 --- a/README.md +++ b/README.md @@ -2612,16 +2612,16 @@ To install and load packages during the early-init phase, add the following to ` ;; (setq warning-suppress-types '((package))) ;; Initialize packages in the early-init phase instead of init -(progn +(when (bound-and-true-p minimal-emacs-package-initialize-and-refresh) + ;; Initialize and refresh package contents again if needed (package-initialize) - (unless package-archive-contents - (package-refresh-contents)) (unless (package-installed-p 'use-package) + (unless (seq-empty-p package-archive-contents) + (package-refresh-contents)) (package-install 'use-package)) - (eval-when-compile - (require 'use-package))) + (require 'use-package)) -;; TODO: Add your use-package code here +;; TODO: Add your use-package packages here ``` ### Minimal-emacs.d configurations from users From 35d2f3956b3d5f9a1a3120af47883eb273e495a1 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 10:26:37 -0500 Subject: [PATCH 065/113] Update README.md --- README.md | 374 +++++++++++++++++++++++++++--------------------------- 1 file changed, 187 insertions(+), 187 deletions(-) diff --git a/README.md b/README.md index 80b7c0d..e9391bc 100644 --- a/README.md +++ b/README.md @@ -96,11 +96,6 @@ Please share your configuration. It could serve as inspiration for other users. - [auto-save-visited-mode (Save file buffers after a few seconds of inactivity)](#auto-save-visited-mode-save-file-buffers-after-a-few-seconds-of-inactivity) - [Completion System (Corfu, Vertico, Consult)](#completion-system-corfu-vertico-consult) - [Vertico, Consult, Marginalia, and Embark](#vertico-consult-marginalia-and-embark) - - [Code folding](#code-folding) - - [Kirigami: A unified interface for opening and closing folds](#kirigami-a-unified-interface-for-opening-and-closing-folds) - - [outline-minor-mode and hs-minor-mode](#outline-minor-mode-and-hs-minor-mode) - - [outline-indent-minor-mode: Folding based on indentation levels](#outline-indent-minor-mode-folding-based-on-indentation-levels) - - [treesit-fold](#treesit-fold) - [Enhancing undo/redo](#enhancing-undoredo) - [Changing the default theme](#changing-the-default-theme) - [Configuring Vim keybindings using Evil?](#configuring-vim-keybindings-using-evil) @@ -109,9 +104,14 @@ Please share your configuration. It could serve as inspiration for other users. - [Asynchronous code formatting without cursor disruption](#asynchronous-code-formatting-without-cursor-disruption) - [Context-aware 'go to definition' functionality for 50+ programming languages](#context-aware-go-to-definition-functionality-for-50-programming-languages) - [Efficient template expansion with snippets](#efficient-template-expansion-with-snippets) + - [Code folding](#code-folding) + - [Kirigami: A unified interface for opening and closing folds](#kirigami-a-unified-interface-for-opening-and-closing-folds) + - [outline-minor-mode and hs-minor-mode](#outline-minor-mode-and-hs-minor-mode) + - [outline-indent-minor-mode: Folding based on indentation levels](#outline-indent-minor-mode-folding-based-on-indentation-levels) + - [treesit-fold](#treesit-fold) + - [Spell checker](#spell-checker) - [Automatic removal of trailing whitespace on save](#automatic-removal-of-trailing-whitespace-on-save) - [Highlighting uncommitted changes in the buffer margin (e.g., Git changes)](#highlighting-uncommitted-changes-in-the-buffer-margin-eg-git-changes) - - [Spell checker](#spell-checker) - [Configuring org-mode](#configuring-org-mode) - [Configuring LSP Servers with Eglot (built-in)](#configuring-lsp-servers-with-eglot-built-in) - [Auto upgrade Emacs packages](#auto-upgrade-emacs-packages) @@ -634,146 +634,6 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E (setq consult-narrow-key "<")) ``` -### Code folding - -#### Kirigami: A unified interface for opening and closing folds - -The [kirigami](https://github.com/jamescherti/kirigami.el) package offers a **unified interface for opening and closing folds** across a diverse set of major and minor modes in Emacs, including `outline-mode`, `outline-minor-mode`, `outline-indent-minor-mode`, `org-mode`, `markdown-mode`, `gfm-mode`, `vdiff-mode`, `vdiff-3way-mode`, `hs-minor-mode`, `hide-ifdef-mode`, `origami-mode`, `yafolding-mode`, `folding-mode`, and `treesit-fold-mode`. -```elisp -(use-package kirigami - :commands (kirigami-open-fold - kirigami-open-fold-rec - kirigami-close-fold - kirigami-toggle-fold - kirigami-open-folds - kirigami-close-folds-except-current - kirigami-close-folds) - - :init - (global-set-key (kbd "C-c k o") 'kirigami-open-fold) ; Open fold at point - (global-set-key (kbd "C-c k c") 'kirigami-close-fold) ; Close fold at point - (global-set-key (kbd "C-c k m") 'kirigami-close-folds) ; Close all folds - (global-set-key (kbd "C-c k r") 'kirigami-open-folds) ; Open all folds - (global-set-key (kbd "C-c k O") 'kirigami-open-fold-rec) ; Open fold recursively - (global-set-key (kbd "C-c k TAB") 'kirigami-toggle-fold)) ; Toggle fold at point - -;; Uncomment the following if you are an `evil-mode' user: -;; (with-eval-after-load 'evil -;; (define-key evil-normal-state-map "zo" 'kirigami-open-fold) -;; (define-key evil-normal-state-map "zO" 'kirigami-open-fold-rec) -;; (define-key evil-normal-state-map "zc" 'kirigami-close-fold) -;; (define-key evil-normal-state-map "za" 'kirigami-toggle-fold) -;; (define-key evil-normal-state-map "zr" 'kirigami-open-folds) -;; (define-key evil-normal-state-map "zm" 'kirigami-close-folds)) -``` - -With Kirigami, folding key bindings only need to be configured **once**. After that, the same keys work consistently across all supported major and minor modes, providing a unified and predictable experience for opening and closing folds. - -In addition to unified interface for opening and closing folds, the **kirigami** package: -- **Enhances Visual Stability on Fold Opening and Closing:** Preserves the cursor's exact vertical position when expanding or collapsing headings, maintaining a constant relative distance between the cursor and the window start. This Kirigami enhancement avoids the disruptive window jump or forced re-centering commonly observed during bulk folding operations. -- **Enhances outline:** Kirigami improves folding behavior in `outline-mode`, `outline-minor-mode`, `markdown-mode`, `gfm-mode`, and `org-mode`. It ensures that deep folds open reliably and permits closing folds even when the cursor is positioned within the content body. Additionally, it maintains window-start heading stability by automatically adjusting the scroll position to keep folded headings visible, preventing the context from disappearing when closing a fold that is partially scrolled off-screen. -- **Hooks for Folding Actions:** Two hooks, `kirigami-pre-action-predicates` and `kirigami-post-action-functions`, let external code run before and after every folding operation. The pre-action hook runs just before a fold is opened or closed and can allow or block the action. The post-action hook runs once the change is complete and can be used to update UI elements or keep external packages in sync with the new folding state. - -#### outline-minor-mode and hs-minor-mode - -One of the modes that provide code folding is `outline-minor-mode` provides structured code folding in modes such as Emacs Lisp and Python, allowing users to collapse and expand sections based on headings or indentation levels. This feature enhances navigation and improves the management of large files with hierarchical structures. - -Alternatively, `hs-minor-mode` offers basic code folding for blocks defined by curly braces, functions, or other language-specific delimiters. However, for more flexible folding that supports multiple nested levels, `outline-minor-mode` is generally the preferred choice, as it enables finer control over section visibility in deeply structured code. - -For example, to enable `outline-minor-mode` in Emacs Lisp: - -``` emacs-lisp -;; The built-in outline-minor-mode provides structured code folding in modes -;; such as Emacs Lisp and Python, allowing users to collapse and expand sections -;; based on headings or indentation levels. This feature enhances navigation and -;; improves the management of large files with hierarchical structures. -(use-package outline - :ensure nil - :commands outline-minor-mode - :hook - ((emacs-lisp-mode . outline-minor-mode) - ;; Use " ▼" instead of the default ellipsis "..." for folded text to make - ;; folds more visually distinctive and readable. - (outline-minor-mode - . - (lambda() - (let* ((display-table (or buffer-display-table (make-display-table))) - (face-offset (* (face-id 'shadow) (ash 1 22))) - (value (vconcat (mapcar (lambda (c) (+ face-offset c)) " ▼")))) - (set-display-table-slot display-table 'selective-display value) - (setq buffer-display-table display-table)))))) -``` - -#### outline-indent-minor-mode: Folding based on indentation levels - -For folding based on indentation levels, the **[outline-indent](https://github.com/jamescherti/outline-indent.el)** Emacs package provides a minor mode that enables folding according to the indentation structure: -```elisp -;; The outline-indent Emacs package provides a minor mode that enables code -;; folding based on indentation levels. -;; -;; In addition to code folding, *outline-indent* allows: -;; - Moving indented blocks up and down -;; - Indenting/unindenting to adjust indentation levels -;; - Inserting a new line with the same indentation level as the current line -;; - Move backward/forward to the indentation level of the current line -;; - and other features. -(use-package outline-indent - :ensure t - :commands outline-indent-minor-mode - - :custom - (outline-indent-ellipsis " ▼") - - :init - ;; The minor mode can also be automatically activated for a certain modes. - (add-hook 'python-mode-hook #'outline-indent-minor-mode) - (add-hook 'python-ts-mode-hook #'outline-indent-minor-mode) - - (add-hook 'yaml-mode-hook #'outline-indent-minor-mode) - (add-hook 'yaml-ts-mode-hook #'outline-indent-minor-mode)) -``` - -![](https://raw.githubusercontent.com/jamescherti/outline-indent.el/main/.images/screenshot2.png) - -#### treesit-fold - -It is also recommended to install [treesit-fold](https://github.com/emacs-tree-sitter/treesit-fold), which provides intelligent code folding by leveraging the structural understanding of the built-in tree-sitter parser. Unlike traditional folding methods that rely on regular expressions or indentation, treesit-fold uses the actual syntax tree of the code to accurately identify foldable regions such as functions, classes, comments, and documentation strings. This allows for faster and more precise folding behavior that respects the grammar of the programming language, ensuring that fold boundaries are always syntactically correct even in complex or nested code structures. -```elisp -;; Intelligent code folding by leveraging the structural understanding of the -;; built-in tree-sitter parser. Unlike traditional folding methods that rely on -;; regular expressions or indentation, treesit-fold uses the actual syntax tree -;; of the code to accurately identify foldable regions such as functions, -;; classes, comments, and documentation strings. This allows for faster and more -;; precise folding behavior that respects the grammar of the programming -;; language, ensuring that fold boundaries are always syntactically correct even -;; in complex or nested code structures. -(use-package treesit-fold - :commands (treesit-fold-close - treesit-fold-close-all - treesit-fold-open - treesit-fold-toggle - treesit-fold-open-all - treesit-fold-mode - global-treesit-fold-mode - treesit-fold-open-recursively - treesit-fold-line-comment-mode) - - :custom - (treesit-fold-line-count-show t) - (treesit-fold-line-count-format " ▼") - - :config - (set-face-attribute 'treesit-fold-replacement-face nil - :foreground "#808080" - :box nil - :weight 'bold)) -``` - -The `treesit-fold` mode can be enabled using `treesit-fold-mode` or a hook such as: -```elisp -(add-hook 'python-ts-mode-hook #'treesit-fold-mode) -``` - ### Enhancing undo/redo 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. @@ -1163,59 +1023,144 @@ The [yasnippet-snippets](https://github.com/AndreaCrotti/yasnippet-snippets) pac (setq yas-verbosity 0)) ``` -### Automatic removal of trailing whitespace on save +### Code folding -**Trailing whitespace** refers to any spaces or tabs that appear after the last non-whitespace character on a line. These characters have no semantic value and can lead to unnecessary diffs in version control, inconsistent formatting, or visual clutter. Removing them improves code clarity and consistency. +#### Kirigami: A unified interface for opening and closing folds -The [stripspace](https://github.com/jamescherti/stripspace.el) Emacs package provides `stripspace-local-mode`, a minor mode that automatically removes trailing whitespace and blank lines at the end of the buffer when saving. - -To enable **stripspace** and automatically delete trailing whitespace, add the following configuration to `~/.emacs.d/post-init.el`: +The [kirigami](https://github.com/jamescherti/kirigami.el) package offers a **unified interface for opening and closing folds** across a diverse set of major and minor modes in Emacs, including `outline-mode`, `outline-minor-mode`, `outline-indent-minor-mode`, `org-mode`, `markdown-mode`, `gfm-mode`, `vdiff-mode`, `vdiff-3way-mode`, `hs-minor-mode`, `hide-ifdef-mode`, `origami-mode`, `yafolding-mode`, `folding-mode`, and `treesit-fold-mode`. ```elisp -;; The stripspace Emacs package provides stripspace-local-mode, a minor mode -;; that automatically removes trailing whitespace and blank lines at the end of -;; the buffer when saving. -(use-package stripspace - :ensure t - :commands stripspace-local-mode +(use-package kirigami + :commands (kirigami-open-fold + kirigami-open-fold-rec + kirigami-close-fold + kirigami-toggle-fold + kirigami-open-folds + kirigami-close-folds-except-current + kirigami-close-folds) - ;; Enable for prog-mode-hook, text-mode-hook, conf-mode-hook - :hook ((prog-mode . stripspace-local-mode) - (text-mode . stripspace-local-mode) - (conf-mode . stripspace-local-mode)) + :init + (global-set-key (kbd "C-c k o") 'kirigami-open-fold) ; Open fold at point + (global-set-key (kbd "C-c k c") 'kirigami-close-fold) ; Close fold at point + (global-set-key (kbd "C-c k m") 'kirigami-close-folds) ; Close all folds + (global-set-key (kbd "C-c k r") 'kirigami-open-folds) ; Open all folds + (global-set-key (kbd "C-c k O") 'kirigami-open-fold-rec) ; Open fold recursively + (global-set-key (kbd "C-c k TAB") 'kirigami-toggle-fold)) ; Toggle fold at point - :custom - ;; The `stripspace-only-if-initially-clean' option: - ;; - nil to always delete trailing whitespace. - ;; - Non-nil to only delete whitespace when the buffer is clean initially. - ;; (The initial cleanliness check is performed when `stripspace-local-mode' - ;; is enabled.) - (stripspace-only-if-initially-clean nil) - - ;; Enabling `stripspace-restore-column' preserves the cursor's column position - ;; even after stripping spaces. This is useful in scenarios where you add - ;; extra spaces and then save the file. Although the spaces are removed in the - ;; saved file, the cursor remains in the same position, ensuring a consistent - ;; editing experience without affecting cursor placement. - (stripspace-restore-column t)) +;; Uncomment the following if you are an `evil-mode' user: +;; (with-eval-after-load 'evil +;; (define-key evil-normal-state-map "zo" 'kirigami-open-fold) +;; (define-key evil-normal-state-map "zO" 'kirigami-open-fold-rec) +;; (define-key evil-normal-state-map "zc" 'kirigami-close-fold) +;; (define-key evil-normal-state-map "za" 'kirigami-toggle-fold) +;; (define-key evil-normal-state-map "zr" 'kirigami-open-folds) +;; (define-key evil-normal-state-map "zm" 'kirigami-close-folds)) ``` -### Highlighting uncommitted changes in the buffer margin (e.g., Git changes) +With Kirigami, folding key bindings only need to be configured **once**. After that, the same keys work consistently across all supported major and minor modes, providing a unified and predictable experience for opening and closing folds. -The [diff-hl](https://github.com/dgutov/diff-hl) package highlights uncommitted changes in the window margin, enabling navigation between them. Also known as source control gutter indicators, it displays added, modified, and deleted lines in real time. In Git-controlled buffers, changes can be staged and unstaged directly, providing a clear view of version-control changes without running `git diff`. By default, the module does not start `diff-hl-mode` automatically. +In addition to unified interface for opening and closing folds, the **kirigami** package: +- **Enhances Visual Stability on Fold Opening and Closing:** Preserves the cursor's exact vertical position when expanding or collapsing headings, maintaining a constant relative distance between the cursor and the window start. This Kirigami enhancement avoids the disruptive window jump or forced re-centering commonly observed during bulk folding operations. +- **Enhances outline:** Kirigami improves folding behavior in `outline-mode`, `outline-minor-mode`, `markdown-mode`, `gfm-mode`, and `org-mode`. It ensures that deep folds open reliably and permits closing folds even when the cursor is positioned within the content body. Additionally, it maintains window-start heading stability by automatically adjusting the scroll position to keep folded headings visible, preventing the context from disappearing when closing a fold that is partially scrolled off-screen. +- **Hooks for Folding Actions:** Two hooks, `kirigami-pre-action-predicates` and `kirigami-post-action-functions`, let external code run before and after every folding operation. The pre-action hook runs just before a fold is opened or closed and can allow or block the action. The post-action hook runs once the change is complete and can be used to update UI elements or keep external packages in sync with the new folding state. -![](https://raw.githubusercontent.com/dgutov/diff-hl/refs/heads/master/screenshot.png) +#### outline-minor-mode and hs-minor-mode -To configure the *diff-hl* package, add the following to your `~/.emacs.d/post-init.el`: +One of the modes that provide code folding is `outline-minor-mode` provides structured code folding in modes such as Emacs Lisp and Python, allowing users to collapse and expand sections based on headings or indentation levels. This feature enhances navigation and improves the management of large files with hierarchical structures. + +Alternatively, `hs-minor-mode` offers basic code folding for blocks defined by curly braces, functions, or other language-specific delimiters. However, for more flexible folding that supports multiple nested levels, `outline-minor-mode` is generally the preferred choice, as it enables finer control over section visibility in deeply structured code. + +For example, to enable `outline-minor-mode` in Emacs Lisp: + +``` emacs-lisp +;; The built-in outline-minor-mode provides structured code folding in modes +;; such as Emacs Lisp and Python, allowing users to collapse and expand sections +;; based on headings or indentation levels. This feature enhances navigation and +;; improves the management of large files with hierarchical structures. +(use-package outline + :ensure nil + :commands outline-minor-mode + :hook + ((emacs-lisp-mode . outline-minor-mode) + ;; Use " ▼" instead of the default ellipsis "..." for folded text to make + ;; folds more visually distinctive and readable. + (outline-minor-mode + . + (lambda() + (let* ((display-table (or buffer-display-table (make-display-table))) + (face-offset (* (face-id 'shadow) (ash 1 22))) + (value (vconcat (mapcar (lambda (c) (+ face-offset c)) " ▼")))) + (set-display-table-slot display-table 'selective-display value) + (setq buffer-display-table display-table)))))) +``` + +#### outline-indent-minor-mode: Folding based on indentation levels + +For folding based on indentation levels, the **[outline-indent](https://github.com/jamescherti/outline-indent.el)** Emacs package provides a minor mode that enables folding according to the indentation structure: ```elisp -(use-package diff-hl - :commands (diff-hl-mode - global-diff-hl-mode) - :hook (prog-mode . diff-hl-mode) +;; The outline-indent Emacs package provides a minor mode that enables code +;; folding based on indentation levels. +;; +;; In addition to code folding, *outline-indent* allows: +;; - Moving indented blocks up and down +;; - Indenting/unindenting to adjust indentation levels +;; - Inserting a new line with the same indentation level as the current line +;; - Move backward/forward to the indentation level of the current line +;; - and other features. +(use-package outline-indent + :ensure t + :commands outline-indent-minor-mode + + :custom + (outline-indent-ellipsis " ▼") + :init - (setq diff-hl-flydiff-delay 0.4) ; Faster - (setq diff-hl-show-staged-changes nil) ; Realtime feedback - (setq diff-hl-update-async t) ; Do not block Emacs - (setq diff-hl-global-modes '(not pdf-view-mode image-mode))) + ;; The minor mode can also be automatically activated for a certain modes. + (add-hook 'python-mode-hook #'outline-indent-minor-mode) + (add-hook 'python-ts-mode-hook #'outline-indent-minor-mode) + + (add-hook 'yaml-mode-hook #'outline-indent-minor-mode) + (add-hook 'yaml-ts-mode-hook #'outline-indent-minor-mode)) +``` + +![](https://raw.githubusercontent.com/jamescherti/outline-indent.el/main/.images/screenshot2.png) + +#### treesit-fold + +It is also recommended to install [treesit-fold](https://github.com/emacs-tree-sitter/treesit-fold), which provides intelligent code folding by leveraging the structural understanding of the built-in tree-sitter parser. Unlike traditional folding methods that rely on regular expressions or indentation, treesit-fold uses the actual syntax tree of the code to accurately identify foldable regions such as functions, classes, comments, and documentation strings. This allows for faster and more precise folding behavior that respects the grammar of the programming language, ensuring that fold boundaries are always syntactically correct even in complex or nested code structures. +```elisp +;; Intelligent code folding by leveraging the structural understanding of the +;; built-in tree-sitter parser. Unlike traditional folding methods that rely on +;; regular expressions or indentation, treesit-fold uses the actual syntax tree +;; of the code to accurately identify foldable regions such as functions, +;; classes, comments, and documentation strings. This allows for faster and more +;; precise folding behavior that respects the grammar of the programming +;; language, ensuring that fold boundaries are always syntactically correct even +;; in complex or nested code structures. +(use-package treesit-fold + :commands (treesit-fold-close + treesit-fold-close-all + treesit-fold-open + treesit-fold-toggle + treesit-fold-open-all + treesit-fold-mode + global-treesit-fold-mode + treesit-fold-open-recursively + treesit-fold-line-comment-mode) + + :custom + (treesit-fold-line-count-show t) + (treesit-fold-line-count-format " ▼") + + :config + (set-face-attribute 'treesit-fold-replacement-face nil + :foreground "#808080" + :box nil + :weight 'bold)) +``` + +The `treesit-fold` mode can be enabled using `treesit-fold-mode` or a hook such as: +```elisp +(add-hook 'python-ts-mode-hook #'treesit-fold-mode) ``` ### Spell checker @@ -1285,6 +1230,61 @@ To configure **flyspell**, add the following to `~/.emacs.d/post-init.el`: flyspell-prog-text-faces))) ``` +### Automatic removal of trailing whitespace on save + +**Trailing whitespace** refers to any spaces or tabs that appear after the last non-whitespace character on a line. These characters have no semantic value and can lead to unnecessary diffs in version control, inconsistent formatting, or visual clutter. Removing them improves code clarity and consistency. + +The [stripspace](https://github.com/jamescherti/stripspace.el) Emacs package provides `stripspace-local-mode`, a minor mode that automatically removes trailing whitespace and blank lines at the end of the buffer when saving. + +To enable **stripspace** and automatically delete trailing whitespace, add the following configuration to `~/.emacs.d/post-init.el`: +```elisp +;; The stripspace Emacs package provides stripspace-local-mode, a minor mode +;; that automatically removes trailing whitespace and blank lines at the end of +;; the buffer when saving. +(use-package stripspace + :ensure t + :commands stripspace-local-mode + + ;; Enable for prog-mode-hook, text-mode-hook, conf-mode-hook + :hook ((prog-mode . stripspace-local-mode) + (text-mode . stripspace-local-mode) + (conf-mode . stripspace-local-mode)) + + :custom + ;; The `stripspace-only-if-initially-clean' option: + ;; - nil to always delete trailing whitespace. + ;; - Non-nil to only delete whitespace when the buffer is clean initially. + ;; (The initial cleanliness check is performed when `stripspace-local-mode' + ;; is enabled.) + (stripspace-only-if-initially-clean nil) + + ;; Enabling `stripspace-restore-column' preserves the cursor's column position + ;; even after stripping spaces. This is useful in scenarios where you add + ;; extra spaces and then save the file. Although the spaces are removed in the + ;; saved file, the cursor remains in the same position, ensuring a consistent + ;; editing experience without affecting cursor placement. + (stripspace-restore-column t)) +``` + +### Highlighting uncommitted changes in the buffer margin (e.g., Git changes) + +The [diff-hl](https://github.com/dgutov/diff-hl) package highlights uncommitted changes in the window margin, enabling navigation between them. Also known as source control gutter indicators, it displays added, modified, and deleted lines in real time. In Git-controlled buffers, changes can be staged and unstaged directly, providing a clear view of version-control changes without running `git diff`. By default, the module does not start `diff-hl-mode` automatically. + +![](https://raw.githubusercontent.com/dgutov/diff-hl/refs/heads/master/screenshot.png) + +To configure the *diff-hl* package, add the following to your `~/.emacs.d/post-init.el`: +```elisp +(use-package diff-hl + :commands (diff-hl-mode + global-diff-hl-mode) + :hook (prog-mode . diff-hl-mode) + :init + (setq diff-hl-flydiff-delay 0.4) ; Faster + (setq diff-hl-show-staged-changes nil) ; Realtime feedback + (setq diff-hl-update-async t) ; Do not block Emacs + (setq diff-hl-global-modes '(not pdf-view-mode image-mode))) +``` + ### Configuring org-mode Org mode is a major mode designed for organizing notes, planning, task management, and authoring documents using plain text with a simple and expressive markup syntax. It supports hierarchical outlines, TODO lists, scheduling, deadlines, time tracking, and exporting to multiple formats including HTML, LaTeX, PDF, and Markdown. From f23446e663959a574996bb4b4edb707447c814ab Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 11:29:56 -0500 Subject: [PATCH 066/113] Remove cursor-in-non-selected-windows --- init.el | 1 - 1 file changed, 1 deletion(-) diff --git a/init.el b/init.el index 5883b03..1e0d8a5 100644 --- a/init.el +++ b/init.el @@ -326,7 +326,6 @@ ;; Reduce rendering/line scan work by not rendering cursors or regions in ;; non-focused windows. -(setq-default cursor-in-non-selected-windows nil) (setq highlight-nonselected-windows nil) ;;; Text editing, indent, font, and formatting From 337cc567127b1da4f77415e29fa13731634bced0 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 13:19:50 -0500 Subject: [PATCH 067/113] Update README.md --- README.md | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/README.md b/README.md index e9391bc..0d58232 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,6 @@ Please share your configuration. It could serve as inspiration for other users. - [Renaming and deleting files](#renaming-and-deleting-files) - [Enhancing the Elisp development experience](#enhancing-the-elisp-development-experience) - [Inhibiting the mouse](#inhibiting-the-mouse) - - [Tree-sitter Integration (Better Syntax Highlighting)](#tree-sitter-integration-better-syntax-highlighting) - [Showing the tab-bar](#showing-the-tab-bar) - [Offline Dictionary](#offline-dictionary) - [Changing the Default Font](#changing-the-default-font) @@ -1719,29 +1718,6 @@ To configure **inhibit-mouse**, add the following to `~/.emacs.d/post-init.el`: NOTE: `inhibit-mouse-mode` allows users to disable and re-enable mouse functionality, giving them the flexibility to use the mouse when needed. -### 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. - -The configuration below enables Tree-sitter support using the [treesit-auto](https://github.com/renzmann/treesit-auto) package. Setting `treesit-auto-add-to-auto-mode-alist` to `'all` ensures that all available Tree-sitter modes are automatically activated for their corresponding file types. Enabling `global-treesit-auto-mode` applies this behavior globally, improving syntax accuracy and consistency across supported languages. - -To enable Tree-sitter, add the following to your `~/.emacs.d/post-init.el`: - -```elisp -;; Tree-sitter in Emacs is an incremental parsing system introduced in Emacs 29 -;; that provides precise, high-performance syntax highlighting. 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. -(use-package treesit-auto - :ensure t - :custom - (treesit-auto-install 'prompt) - :config - (treesit-auto-add-to-auto-mode-alist 'all) - (global-treesit-auto-mode)) -``` - ### Showing the tab-bar Configure the `tab-bar-show` variable to 1 to display the tab bar exclusively when multiple tabs are open: From d7ae34541bd4c8ace51cd591f905252d64fc673e Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 13:22:59 -0500 Subject: [PATCH 068/113] Update README.md --- README.md | 221 +++++++++++++++++++++++++++++------------------------- 1 file changed, 119 insertions(+), 102 deletions(-) diff --git a/README.md b/README.md index 0d58232..de833da 100644 --- a/README.md +++ b/README.md @@ -101,14 +101,14 @@ Please share your configuration. It could serve as inspiration for other users. - [Configuring Vim keybindings using Evil?](#configuring-vim-keybindings-using-evil) - [Persisting and Restoring all buffers, windows/split, tab-bar, frames...](#persisting-and-restoring-all-buffers-windowssplit-tab-bar-frames) - [Configuring markdown-mode (e.g., README.md syntax)](#configuring-markdown-mode-eg-readmemd-syntax) - - [Asynchronous code formatting without cursor disruption](#asynchronous-code-formatting-without-cursor-disruption) - - [Context-aware 'go to definition' functionality for 50+ programming languages](#context-aware-go-to-definition-functionality-for-50-programming-languages) - - [Efficient template expansion with snippets](#efficient-template-expansion-with-snippets) - [Code folding](#code-folding) - [Kirigami: A unified interface for opening and closing folds](#kirigami-a-unified-interface-for-opening-and-closing-folds) - [outline-minor-mode and hs-minor-mode](#outline-minor-mode-and-hs-minor-mode) - [outline-indent-minor-mode: Folding based on indentation levels](#outline-indent-minor-mode-folding-based-on-indentation-levels) - [treesit-fold](#treesit-fold) + - [Asynchronous code formatting without cursor disruption](#asynchronous-code-formatting-without-cursor-disruption) + - [Context-aware 'go to definition' functionality for 50+ programming languages](#context-aware-go-to-definition-functionality-for-50-programming-languages) + - [Efficient template expansion with snippets](#efficient-template-expansion-with-snippets) - [Spell checker](#spell-checker) - [Automatic removal of trailing whitespace on save](#automatic-removal-of-trailing-whitespace-on-save) - [Highlighting uncommitted changes in the buffer margin (e.g., Git changes)](#highlighting-uncommitted-changes-in-the-buffer-margin-eg-git-changes) @@ -830,7 +830,11 @@ You can also add the following code to enable commenting and uncommenting by pre ### 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. +The [easysession](https://github.com/jamescherti/easysession.el) package provides a comprehensive session management for Emacs. It is capable of persisting and restoring file-visiting buffers, indirect buffers (clones), buffer narrowing, Dired buffers, window configurations, the built-in tab-bar (including tabs, their buffers, and associated windows), as well as entire Emacs frames. + +With **easysession**, your Emacs setup is restored automatically when you restart. All files, Dired buffers, and window layouts come back as they were, so you can continue working right where you left off. While editing, you can also switch to another session, switch back, rename sessions, or delete them, giving you full control over multiple work environments. + +Easysession also supports extensions, enabling the restoration of Magit buffers and the scratch buffer. Custom extensions can also be created to extend its functionality. To configure **easysession**, add the following to `~/.emacs.d/post-init.el`: ``` emacs-lisp @@ -925,108 +929,24 @@ These commands work on any Markdown buffer and rely on properly formatted header 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/). -### 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. - -Apheleia solves both problems across all languages, replacing language-specific packages like Blacken and prettier-js. It does this by invoking formatters in an `after-save-hook`, ensuring changes are applied only if the buffer remains unmodified. - -To maintain cursor stability, Apheleia generates an RCS patch, applies it selectively, and employs a dynamic programming algorithm to reposition the cursor if necessary. If the formatting alters the vertical position of the cursor in the window, Apheleia adjusts the scroll position to preserve visual continuity across all displayed instances of the buffer. This allows enjoying automated code formatting without sacrificing editor responsiveness or usability. - -To configure **apheleia**, add the following to `~/.emacs.d/post-init.el`: -```elisp -;; Apheleia is an Emacs package designed to run code formatters (e.g., Shfmt, -;; Black and Prettier) asynchronously without disrupting the cursor position. -(use-package apheleia - :ensure t - :commands (apheleia-mode - apheleia-global-mode) - :hook ((prog-mode . apheleia-mode))) -``` - -### Context-aware 'go to definition' functionality for 50+ programming languages - -The [dumb-jump](https://github.com/jacktasia/dumb-jump) package provides context-aware 'go to definition' functionality for 50+ programming languages without requiring a language server. It works by using simple heuristics and regular expression searches to locate the definitions of functions, variables, and symbols across project files. - -Unlike more sophisticated language-aware tools (e.g., eglot or lsp-mode), `dumb-jump' does not parse code semantically, which makes it lightweight and fast, but sometimes less precise. It integrates with popular navigation packages like `xref', allowing users to jump to definitions or references. - -To configure **dumb-jump**, add the following to `~/.emacs.d/post-init.el`: -```elisp -(use-package dumb-jump - :commands dumb-jump-xref-activate - :init - ;; Register `dumb-jump' as an xref backend so it integrates with - ;; `xref-find-definitions'. A priority of 90 ensures it is used only when no - ;; more specific backend is available. - (add-hook 'xref-backend-functions #'dumb-jump-xref-activate 90) - - (setq dumb-jump-aggressive nil) - ;; (setq dumb-jump-quiet t) - - ;; Number of seconds a rg/grep/find command can take before being warned to - ;; use ag and config. - (setq dumb-jump-max-find-time 3) - - ;; Use `completing-read' so that selection of jump targets integrates with the - ;; active completion framework (e.g., Vertico, Ivy, Helm, Icomplete), - ;; providing a consistent minibuffer-based interface whenever multiple - ;; definitions are found. - (setq dumb-jump-selector 'completing-read) - - ;; If ripgrep is available, force `dumb-jump' to use it because it is - ;; significantly faster and more accurate than the default searchers (grep, - ;; ag, etc.). - (when (executable-find "rg") - (setq dumb-jump-force-searcher 'rg) - (setq dumb-jump-prefer-searcher 'rg))) -``` - -### 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. 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... - -(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)) -``` - ### Code folding #### Kirigami: A unified interface for opening and closing folds -The [kirigami](https://github.com/jamescherti/kirigami.el) package offers a **unified interface for opening and closing folds** across a diverse set of major and minor modes in Emacs, including `outline-mode`, `outline-minor-mode`, `outline-indent-minor-mode`, `org-mode`, `markdown-mode`, `gfm-mode`, `vdiff-mode`, `vdiff-3way-mode`, `hs-minor-mode`, `hide-ifdef-mode`, `origami-mode`, `yafolding-mode`, `folding-mode`, and `treesit-fold-mode`. +The [kirigami](https://github.com/jamescherti/kirigami.el) package provides a unified method to fold and unfold text in Emacs across a diverse set of Emacs modes. + +**Supported modes include:** `outline-mode`, `outline-minor-mode`, `outline-indent-minor-mode`, `org-mode`, `markdown-mode`, `gfm-mode`, `vdiff-mode`, `vdiff-3way-mode`, `hide-ifdef-mode`, `vimish-fold-mode`, `TeX-fold-mode` (AUCTeX), `fold-this-mode`, `origami-mode`, `yafolding-mode`, `folding-mode`, `ts-fold-mode`, `treesit-fold-mode`, and `hs-minor-mode` (hideshow). + +With Kirigami, folding key bindings only need to be configured **once**. After that, the same keys work consistently across all supported major and minor modes, providing a unified and predictable experience for opening and closing folds. The available commands include: + +* `kirigami-open-fold`: Open the fold at point. +* `kirigami-open-fold-rec`: Open the fold at point recursively. +* `kirigami-close-fold`: Close the fold at point. +* `kirigami-open-folds`: Open all folds in the buffer. +* `kirigami-close-folds`: Close all folds in the buffer. +* `kirigami-toggle-fold`: Toggle the fold at point. + +To configure **kirigami**, add the following to `~/.emacs.d/post-init.el`: ```elisp (use-package kirigami :commands (kirigami-open-fold @@ -1162,6 +1082,103 @@ The `treesit-fold` mode can be enabled using `treesit-fold-mode` or a hook such (add-hook 'python-ts-mode-hook #'treesit-fold-mode) ``` +### 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. + +Apheleia solves both problems across all languages, replacing language-specific packages like Blacken and prettier-js. It does this by invoking formatters in an `after-save-hook`, ensuring changes are applied only if the buffer remains unmodified. + +To maintain cursor stability, Apheleia generates an RCS patch, applies it selectively, and employs a dynamic programming algorithm to reposition the cursor if necessary. If the formatting alters the vertical position of the cursor in the window, Apheleia adjusts the scroll position to preserve visual continuity across all displayed instances of the buffer. This allows enjoying automated code formatting without sacrificing editor responsiveness or usability. + +To configure **apheleia**, add the following to `~/.emacs.d/post-init.el`: +```elisp +;; Apheleia is an Emacs package designed to run code formatters (e.g., Shfmt, +;; Black and Prettier) asynchronously without disrupting the cursor position. +(use-package apheleia + :ensure t + :commands (apheleia-mode + apheleia-global-mode) + :hook ((prog-mode . apheleia-mode))) +``` + +### Context-aware 'go to definition' functionality for 50+ programming languages + +The [dumb-jump](https://github.com/jacktasia/dumb-jump) package provides context-aware 'go to definition' functionality for 50+ programming languages without requiring a language server. It works by using simple heuristics and regular expression searches to locate the definitions of functions, variables, and symbols across project files. + +Unlike more sophisticated language-aware tools (e.g., eglot or lsp-mode), `dumb-jump' does not parse code semantically, which makes it lightweight and fast, but sometimes less precise. It integrates with popular navigation packages like `xref', allowing users to jump to definitions or references. + +To configure **dumb-jump**, add the following to `~/.emacs.d/post-init.el`: +```elisp +(use-package dumb-jump + :commands dumb-jump-xref-activate + :init + ;; Register `dumb-jump' as an xref backend so it integrates with + ;; `xref-find-definitions'. A priority of 90 ensures it is used only when no + ;; more specific backend is available. + (add-hook 'xref-backend-functions #'dumb-jump-xref-activate 90) + + (setq dumb-jump-aggressive nil) + ;; (setq dumb-jump-quiet t) + + ;; Number of seconds a rg/grep/find command can take before being warned to + ;; use ag and config. + (setq dumb-jump-max-find-time 3) + + ;; Use `completing-read' so that selection of jump targets integrates with the + ;; active completion framework (e.g., Vertico, Ivy, Helm, Icomplete), + ;; providing a consistent minibuffer-based interface whenever multiple + ;; definitions are found. + (setq dumb-jump-selector 'completing-read) + + ;; If ripgrep is available, force `dumb-jump' to use it because it is + ;; significantly faster and more accurate than the default searchers (grep, + ;; ag, etc.). + (when (executable-find "rg") + (setq dumb-jump-force-searcher 'rg) + (setq dumb-jump-prefer-searcher 'rg))) +``` + +### 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. 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... + +(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)) +``` + ### Spell checker 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. From bc2631c45aa16480fe57127d7dafde2d757658e0 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 13:29:58 -0500 Subject: [PATCH 069/113] Update README.md --- README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/README.md b/README.md index de833da..c1e93a4 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,7 @@ Please share your configuration. It could serve as inspiration for other users. - [Offline Dictionary](#offline-dictionary) - [Changing the Default Font](#changing-the-default-font) - [Persisting Text Scale](#persisting-text-scale) + - [A faster terminal emulator](#a-faster-terminal-emulator) - [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) - [File types (Yaml, Dockerfile, Lua, Jinja2, CSV, Vimrc...)](#file-types-yaml-dockerfile-lua-jinja2-csv-vimrc) @@ -1812,6 +1813,55 @@ To configure the *persist-text-scale* package, add the following to your `~/.ema (text-scale-mode-step 1.07)) ``` +### A faster terminal emulator + +**NOTE:** The vterm package requires external system dependencies, specifically `cmake` (>= 3.11), `libtool-bin`, and `libvterm`. Because it contains a C component, Emacs will prompt you to compile the module the first time you run it. Ensure your environment variables are correctly configured so Emacs can locate your C compiler and build tools. + +The [vterm](https://github.com/akermu/emacs-libvterm) package provides is an Emacs terminal emulator that provides a fully interactive shell experience within Emacs, supporting features such as color, cursor movement, and advanced terminal capabilities. + +Unlike standard Emacs terminal modes, `vterm` utilizes the libvterm C library for high-performance emulation. This ensures accurate terminal behavior when running shell programs, text-based applications, and REPLs. + +To configure the *vterm* package, add the following to your `~/.emacs.d/post-init.el`: +```elisp +;; `vterm' is an Emacs terminal emulator that provides a fully interactive shell +;; experience within Emacs, supporting features such as color, cursor movement, +;; and advanced terminal capabilities. Unlike standard Emacs terminal modes, +;; `vterm' utilizes the libvterm C library for high-performance emulation. This +;; ensures accurate terminal behavior when running shell programs, text-based +;; applications, and REPLs. +(use-package vterm + :if (bound-and-true-p module-file-suffix) + :commands (vterm + vterm-send-string + vterm-send-return + vterm-send-key + vterm-module-compile) + + :preface + (when noninteractive + ;; vterm unnecessarily triggers compilation of vterm-module.so upon loading. + ;; This prevents that during byte-compilation (`use-package' eagerly loads + ;; packages when compiling). + (advice-add #'vterm-module-compile :override #'ignore)) + + (defun my-vterm--setup () + ;; Hide the mode-line + (setq mode-line-format nil) + + ;; Inhibit early horizontal scrolling + (setq-local hscroll-margin 0) + + ;; Suppress prompts for terminating active processes when closing vterm + (setq-local confirm-kill-processes nil)) + + :init + (add-hook 'vterm-mode-hook #'my-vterm--setup) + + (setq vterm-timer-delay 0.05) ; Faster vterm + (setq vterm-kill-buffer-on-exit t) + (setq vterm-max-scrollback 5000)) +``` + ### Loading the custom.el file **NOTE:** The author advises against loading `custom.el`. 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 c83045c814967468c1f628c9975526cbd8ac1962 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 13:30:35 -0500 Subject: [PATCH 070/113] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c1e93a4..c6db33b 100644 --- a/README.md +++ b/README.md @@ -125,8 +125,8 @@ Please share your configuration. It could serve as inspiration for other users. - [Showing the tab-bar](#showing-the-tab-bar) - [Offline Dictionary](#offline-dictionary) - [Changing the Default Font](#changing-the-default-font) - - [Persisting Text Scale](#persisting-text-scale) - - [A faster terminal emulator](#a-faster-terminal-emulator) + - [Persisting and Restoring Text Scale](#persisting-and-restoring-text-scale) + - [A Faster Terminal Emulator](#a-faster-terminal-emulator) - [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) - [File types (Yaml, Dockerfile, Lua, Jinja2, CSV, Vimrc...)](#file-types-yaml-dockerfile-lua-jinja2-csv-vimrc) @@ -1790,7 +1790,7 @@ On Linux, you can display a comprehensive list of all installed font families by fc-list : family | sed 's/,/\n/g' | sort -u ``` -### Persisting Text Scale +### Persisting and Restoring 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. @@ -1813,7 +1813,7 @@ To configure the *persist-text-scale* package, add the following to your `~/.ema (text-scale-mode-step 1.07)) ``` -### A faster terminal emulator +### A Faster Terminal Emulator **NOTE:** The vterm package requires external system dependencies, specifically `cmake` (>= 3.11), `libtool-bin`, and `libvterm`. Because it contains a C component, Emacs will prompt you to compile the module the first time you run it. Ensure your environment variables are correctly configured so Emacs can locate your C compiler and build tools. From ed5f8a352580b7a6d2b8f4138c4711d1bfc29865 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 13:31:43 -0500 Subject: [PATCH 071/113] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c6db33b..e795467 100644 --- a/README.md +++ b/README.md @@ -1862,6 +1862,8 @@ To configure the *vterm* package, add the following to your `~/.emacs.d/post-ini (setq vterm-max-scrollback 5000)) ``` +The `vterm` terminal emulator can be started with `M-x vterm`. + ### Loading the custom.el file **NOTE:** The author advises against loading `custom.el`. 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 7a9ca621d29fd3b5d72cb3fbdc2dfa20d0b175f1 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 13:40:07 -0500 Subject: [PATCH 072/113] Update README.md --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index e795467..a249d8e 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ Please share your configuration. It could serve as inspiration for other users. - [Reducing clutter in `~/.emacs.d` by redirecting files to `~/.emacs.d/var/`](#reducing-clutter-in-emacsd-by-redirecting-files-to-emacsdvar) - [Customizations: Packages (File: post-init.el)](#customizations-packages-file-post-initel) - [Optimization: Native Compilation](#optimization-native-compilation) + - [Environment Variable Synchronization (Essential for macOS users)](#environment-variable-synchronization-essential-for-macos-users) - [File Management & History: recentf, savehist, saveplace, and auto-revert?](#file-management--history-recentf-savehist-saveplace-and-auto-revert) - [Safety: Auto-Save](#safety-auto-save) - [auto-save-mode (Prevent data loss in case of crashes)](#auto-save-mode-prevent-data-loss-in-case-of-crashes) @@ -310,6 +311,26 @@ Native compilation enhances Emacs performance by converting Elisp code into nati (compile-angel-on-load-mode 1)) ``` +### Environment Variable Synchronization (Essential for macOS users) + +On macOS, GUI applications (launched from the Finder, Dock, or Spotlight) do not inherit the user's shell environment variables by default. This often causes errors where Emacs cannot find external tools like `git`, `grep`, `pip`, or language servers (LSP), even if they work perfectly in your terminal. + +To fix this, add `exec-path-from-shell` to `~/.emacs.d/post-init.el`: + +```elisp +(use-package exec-path-from-shell + :if (and (display-graphic-p) + (eq system-type 'darwin)) ; macOS only + :ensure t + :demand t + :functions exec-path-from-shell-initialize + :config + (dolist (var '("TMPDIR" "SSH_AUTH_SOCK" "SSH_AGENT_PID" "GPG_AGENT_INFO" + "LANG" "LC_CTYPE" "VIRTUAL_ENV")) + (add-to-list 'exec-path-from-shell-variables var)) + (exec-path-from-shell-initialize)) +``` + ### File Management & History: recentf, savehist, saveplace, and auto-revert? The recentf, savehist, saveplace, and auto-revert built-in packages are already configured by *minimal-emacs.d*. All you need to do is activate them by adding the following to `~/.emacs.d/post-init.el`: From 1722e0434208911ad0348e8ff58ceb84f4756582 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 13:47:06 -0500 Subject: [PATCH 073/113] Update README.md --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a249d8e..1df6f68 100644 --- a/README.md +++ b/README.md @@ -319,15 +319,23 @@ To fix this, add `exec-path-from-shell` to `~/.emacs.d/post-init.el`: ```elisp (use-package exec-path-from-shell - :if (and (display-graphic-p) + :if (and (or (display-graphic-p) (daemonp)) (eq system-type 'darwin)) ; macOS only :ensure t :demand t :functions exec-path-from-shell-initialize :config - (dolist (var '("TMPDIR" "SSH_AUTH_SOCK" "SSH_AGENT_PID" "GPG_AGENT_INFO" - "LANG" "LC_CTYPE" "VIRTUAL_ENV")) + (dolist (var '("TMPDIR" + "SSH_AUTH_SOCK" "SSH_AGENT_PID" + "GPG_AGENT_INFO" + ;; "FZF_DEFAULT_COMMAND" "FZF_DEFAULT_OPTS" ; fzf + ;; "VIRTUAL_ENV" ; Python + ;; "GOPATH" "GOROOT" "GOBIN" ; Go + ;; "CARGO_HOME" "RUSTUP_HOME" ; Rust + ;; "NVM_DIR" "NODE_PATH" ; Node/JS + "LANG" "LC_CTYPE")) (add-to-list 'exec-path-from-shell-variables var)) + ;; Initialize (exec-path-from-shell-initialize)) ``` From 849f3acec732fe6e5b28e52e2bd06c68d87f5fba Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 13:47:59 -0500 Subject: [PATCH 074/113] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1df6f68..353a709 100644 --- a/README.md +++ b/README.md @@ -315,7 +315,7 @@ Native compilation enhances Emacs performance by converting Elisp code into nati On macOS, GUI applications (launched from the Finder, Dock, or Spotlight) do not inherit the user's shell environment variables by default. This often causes errors where Emacs cannot find external tools like `git`, `grep`, `pip`, or language servers (LSP), even if they work perfectly in your terminal. -To fix this, add `exec-path-from-shell` to `~/.emacs.d/post-init.el`: +To fix this, add **exec-path-from-shell** to `~/.emacs.d/post-init.el`: ```elisp (use-package exec-path-from-shell From 249f381d29847505fe534a593846d1121c9b0edf Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 14:10:43 -0500 Subject: [PATCH 075/113] Update README.md --- README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 353a709..67ec954 100644 --- a/README.md +++ b/README.md @@ -987,13 +987,12 @@ To configure **kirigami**, add the following to `~/.emacs.d/post-init.el`: kirigami-close-folds-except-current kirigami-close-folds) - :init - (global-set-key (kbd "C-c k o") 'kirigami-open-fold) ; Open fold at point - (global-set-key (kbd "C-c k c") 'kirigami-close-fold) ; Close fold at point - (global-set-key (kbd "C-c k m") 'kirigami-close-folds) ; Close all folds - (global-set-key (kbd "C-c k r") 'kirigami-open-folds) ; Open all folds - (global-set-key (kbd "C-c k O") 'kirigami-open-fold-rec) ; Open fold recursively - (global-set-key (kbd "C-c k TAB") 'kirigami-toggle-fold)) ; Toggle fold at point + :bind (("C-c k o" . kirigami-open-fold) + ("C-c k c" . kirigami-close-fold) + ("C-c k m" . kirigami-close-folds) + ("C-c k r" . kirigami-open-folds) + ("C-c k O" . kirigami-open-fold-rec) + ("C-c k " . kirigami-toggle-fold))) ;; Uncomment the following if you are an `evil-mode' user: ;; (with-eval-after-load 'evil From 1820b3fd955df8668c51034d4ed6f1ef51a148ed Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 14:12:38 -0500 Subject: [PATCH 076/113] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 67ec954..b505e01 100644 --- a/README.md +++ b/README.md @@ -987,12 +987,12 @@ To configure **kirigami**, add the following to `~/.emacs.d/post-init.el`: kirigami-close-folds-except-current kirigami-close-folds) - :bind (("C-c k o" . kirigami-open-fold) - ("C-c k c" . kirigami-close-fold) - ("C-c k m" . kirigami-close-folds) - ("C-c k r" . kirigami-open-folds) - ("C-c k O" . kirigami-open-fold-rec) - ("C-c k " . kirigami-toggle-fold))) + :bind (("C-c z o" . kirigami-open-fold) + ("C-c z c" . kirigami-close-fold) + ("C-c z m" . kirigami-close-folds) + ("C-c z r" . kirigami-open-folds) + ("C-c z O" . kirigami-open-fold-rec) + ("C-c z " . kirigami-toggle-fold))) ;; Uncomment the following if you are an `evil-mode' user: ;; (with-eval-after-load 'evil From b2e87061e8145fe2706b23d5547f06a721e989ad Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 14:17:29 -0500 Subject: [PATCH 077/113] Update README.md --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index b505e01..f88d794 100644 --- a/README.md +++ b/README.md @@ -2158,11 +2158,6 @@ These modes are optional and can be added selectively to `~/.emacs.d/post-init.e :commands go-mode :mode ("\\.go\\'" . go-mode)) -;; Support for Haskell -(use-package haskell-mode - :commands haskell-mode - :mode ("\\.hs\\'" . haskell-mode)) - ;; Support for Rust (use-package rust-mode :commands rust-mode From 684d1af64b7bd99f40eb6490f64eddb998100c8a Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 14:24:32 -0500 Subject: [PATCH 078/113] Update README.md --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f88d794..d3dcd95 100644 --- a/README.md +++ b/README.md @@ -276,16 +276,27 @@ Native compilation enhances Emacs performance by converting Elisp code into nati ;; Native compilation enhances Emacs performance by converting Elisp code into ;; native machine code, resulting in faster execution and improved ;; responsiveness. -;; + +;; Uncomment to disable Emacs JIT Native-compile to completely replace it with +;; compile-angel. This can prevents redundant or repetitive background +;; compilations: +;; (setq native-comp-jit-compilation nil) +;; (setq native-comp-deferred-compilation native-comp-jit-compilation) + ;; Ensure adding the following compile-angel code at the very beginning ;; of your `~/.emacs.d/post-init.el` file, before all other packages. (use-package compile-angel :demand t :ensure t - :custom + + :init + ;; The following disables compilation of packages during installation; + ;; compile-angel will handle it. + (setq package-native-compile nil) + ;; Set `compile-angel-verbose` to nil to suppress output from compile-angel. ;; Drawback: The minibuffer will not display compile-angel's actions. - (compile-angel-verbose t) + (setq compile-angel-verbose t) :config ;; The following directive prevents compile-angel from compiling your init From 26e7000c0fec26bb5e0b0695f75bebd734b6234f Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 14:25:42 -0500 Subject: [PATCH 079/113] Remove package-native-compile as it can cause issues with some packages --- early-init.el | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/early-init.el b/early-init.el index d72436a..6e775b8 100644 --- a/early-init.el +++ b/early-init.el @@ -87,7 +87,6 @@ When non-nil, the following variables are set to non-nil to enable native compilation features: - `native-comp-deferred-compilation' - `native-comp-jit-compilation' -- `package-native-compile' If nil, these variables are left at their default values and are not modified during setup.") @@ -187,12 +186,9 @@ pre-early-init.el, and post-early-init.el.") ;;; Native compilation and Byte compilation -(if (and (featurep 'native-compile) - (fboundp 'native-comp-available-p) - (native-comp-available-p)) - (when minimal-emacs-setup-native-compilation - ;; Activate `native-compile' - (setq package-native-compile t)) +(unless (and (featurep 'native-compile) + (fboundp 'native-comp-available-p) + (native-comp-available-p)) ;; Deactivate the `native-compile' feature if it is not available (setq features (delq 'native-compile features))) From a681a78022b7bf55d16ccc3544e0fc5caa432ddc Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 14:27:09 -0500 Subject: [PATCH 080/113] Update README.md --- README.md | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index d3dcd95..2b99583 100644 --- a/README.md +++ b/README.md @@ -276,27 +276,16 @@ Native compilation enhances Emacs performance by converting Elisp code into nati ;; Native compilation enhances Emacs performance by converting Elisp code into ;; native machine code, resulting in faster execution and improved ;; responsiveness. - -;; Uncomment to disable Emacs JIT Native-compile to completely replace it with -;; compile-angel. This can prevents redundant or repetitive background -;; compilations: -;; (setq native-comp-jit-compilation nil) -;; (setq native-comp-deferred-compilation native-comp-jit-compilation) - +;; ;; Ensure adding the following compile-angel code at the very beginning ;; of your `~/.emacs.d/post-init.el` file, before all other packages. (use-package compile-angel :demand t :ensure t - - :init - ;; The following disables compilation of packages during installation; - ;; compile-angel will handle it. - (setq package-native-compile nil) - + :custom ;; Set `compile-angel-verbose` to nil to suppress output from compile-angel. ;; Drawback: The minibuffer will not display compile-angel's actions. - (setq compile-angel-verbose t) + (compile-angel-verbose t) :config ;; The following directive prevents compile-angel from compiling your init @@ -2213,6 +2202,11 @@ These modes are optional and can be added selectively to `~/.emacs.d/post-init.e (use-package jenkinsfile-mode :commands jenkinsfile-mode :mode ("Jenkinsfile\\'" . jenkinsfile-mode)) + +;; Support for Haskell +;; (use-package haskell-mode +;; :commands haskell-mode +;; :mode ("\\.hs\\'" . haskell-mode)) ``` ## Customizations: Before init (File: pre-init.el) From 61676c3f9e262fee1bd4e4698bd7865cd101b9ea Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 14:28:10 -0500 Subject: [PATCH 081/113] Update README.md --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2b99583..7a6a0ac 100644 --- a/README.md +++ b/README.md @@ -280,14 +280,17 @@ Native compilation enhances Emacs performance by converting Elisp code into nati ;; Ensure adding the following compile-angel code at the very beginning ;; of your `~/.emacs.d/post-init.el` file, before all other packages. (use-package compile-angel - :demand t :ensure t - :custom - ;; Set `compile-angel-verbose` to nil to suppress output from compile-angel. - ;; Drawback: The minibuffer will not display compile-angel's actions. - (compile-angel-verbose t) - + :demand t :config + ;; The following disables compilation of packages during installation; + ;; compile-angel will handle it. + (setq package-native-compile nil) + + ;; Set `compile-angel-verbose' to nil to disable compile-angel messages. + ;; (When set to nil, compile-angel won't show which file is being compiled.) + (setq compile-angel-verbose t) + ;; The following directive prevents compile-angel from compiling your init ;; files. If you choose to remove this push to `compile-angel-excluded-files' ;; and compile your pre/post-init files, ensure you understand the From 192f8b43510a8b245c62cf62d2763412ad2657a0 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 23:22:01 -0500 Subject: [PATCH 082/113] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a6a0ac..b64d9ca 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ## Introduction -The **minimal-emacs.d** project is a lightweight and optimized Emacs base (`init.el` and `early-init.el`) that **gives you full control over your configuration**. It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup. +The **minimal-emacs.d** project is a **fast and lightweight** Emacs base (`init.el` and `early-init.el`) that **gives you full control over your configuration**. It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup. In just a few minutes of applying what's in this README.md file, you will possess a fully functional, high-performance Emacs configuration ready for work. You will bypass hours of configuration and the heavy overhead of frameworks like Doom or Spacemacs, gaining immediate access to a foundation featuring optimized garbage collection, sensible UI defaults, and a fast startup. This is your fast track to a vanilla Emacs setup that remains lightweight, responsive, and entirely under your control. From ee1b8868b05ea18ad5400a14f0802c0b443d0aa8 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 23:22:12 -0500 Subject: [PATCH 083/113] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b64d9ca..83c99c0 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The **minimal-emacs.d** project is a **fast and lightweight** Emacs base (`init.el` and `early-init.el`) that **gives you full control over your configuration**. It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup. -In just a few minutes of applying what's in this README.md file, you will possess a fully functional, high-performance Emacs configuration ready for work. You will bypass hours of configuration and the heavy overhead of frameworks like Doom or Spacemacs, gaining immediate access to a foundation featuring optimized garbage collection, sensible UI defaults, and a fast startup. This is your fast track to a vanilla Emacs setup that remains lightweight, responsive, and entirely under your control. +In just a few minutes of applying what's in this README.md file, you will possess a fully functional, high-performance Emacs configuration ready for work. You will bypass hours of configuration and the heavy overhead of frameworks like Doom or Spacemacs, gaining immediate access to a foundation featuring optimized garbage collection, sensible UI defaults, and a fast startup. If this helps your workflow, please show your support by **⭐ starring minimal-emacs.d on GitHub** to help more Emacs users discover its benefits. From 12c05936310f1aafe46e6604da28a880ef0f7223 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Feb 2026 20:33:49 -0500 Subject: [PATCH 084/113] Remove minimal-emacs-setup-native-compilation --- early-init.el | 9 --------- 1 file changed, 9 deletions(-) diff --git a/early-init.el b/early-init.el index 6e775b8..9c73222 100644 --- a/early-init.el +++ b/early-init.el @@ -81,15 +81,6 @@ tradeoff is that the mode line is hidden during the startup phase.") When set to non-nil, Emacs will automatically call `package-initialize' and `package-refresh-contents' to set up and update the package system.") -(defvar minimal-emacs-setup-native-compilation t - "Controls whether native compilation settings are enabled during setup. -When non-nil, the following variables are set to non-nil to enable -native compilation features: -- `native-comp-deferred-compilation' -- `native-comp-jit-compilation' -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 From da208902f87fdf328dae4930e112ffd3602cb0a1 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 20 Feb 2026 09:45:17 -0500 Subject: [PATCH 085/113] Update README.md --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 83c99c0..6709326 100644 --- a/README.md +++ b/README.md @@ -990,12 +990,13 @@ To configure **kirigami**, add the following to `~/.emacs.d/post-init.el`: kirigami-close-folds-except-current kirigami-close-folds) - :bind (("C-c z o" . kirigami-open-fold) - ("C-c z c" . kirigami-close-fold) - ("C-c z m" . kirigami-close-folds) - ("C-c z r" . kirigami-open-folds) - ("C-c z O" . kirigami-open-fold-rec) - ("C-c z " . kirigami-toggle-fold))) + :bind + (("C-c z o" . kirigami-open-fold) ; Open fold at point + ("C-c z O" . kirigami-open-fold-rec) ; Open fold recursively + ("C-c z r" . kirigami-open-folds) ; Open all folds + ("C-c z c" . kirigami-close-fold) ; Close fold at point + ("C-c z m" . kirigami-close-folds) ; Close all folds + ("C-c z " . kirigami-toggle-fold))) ; Toggle fold at point ;; Uncomment the following if you are an `evil-mode' user: ;; (with-eval-after-load 'evil From 9f6961fc6a4c5f5e732d20b6200e51c0d4744e27 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 22 Feb 2026 20:03:43 -0500 Subject: [PATCH 086/113] Do not package-initialize when using straight or elpaca --- init.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index 1e0d8a5..8936cdd 100644 --- a/init.el +++ b/init.el @@ -46,11 +46,13 @@ ;;; package.el -(when (bound-and-true-p minimal-emacs-package-initialize-and-refresh) +(when (and (bound-and-true-p minimal-emacs-package-initialize-and-refresh) + (not (or (fboundp 'straight-use-package) + (fboundp 'elpaca)))) ;; Initialize and refresh package contents again if needed (package-initialize) (unless (package-installed-p 'use-package) - (unless (seq-empty-p package-archive-contents) + (unless package-archive-contents (package-refresh-contents)) (package-install 'use-package)) (require 'use-package)) From d9b1a6fc669294e70e4a7bed92a5c8ef8b0bf681 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 22 Feb 2026 20:12:34 -0500 Subject: [PATCH 087/113] Install use-package only on Emacs < 29 --- init.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/init.el b/init.el index 8936cdd..d8205bb 100644 --- a/init.el +++ b/init.el @@ -51,10 +51,11 @@ (fboundp 'elpaca)))) ;; Initialize and refresh package contents again if needed (package-initialize) - (unless (package-installed-p 'use-package) - (unless package-archive-contents - (package-refresh-contents)) - (package-install 'use-package)) + (when (version< emacs-version "29.1") + (unless (package-installed-p 'use-package) + (unless package-archive-contents + (package-refresh-contents)) + (package-install 'use-package))) (require 'use-package)) ;;; Minibuffer From 1b4bf18a2d621f608e6e2c2f0ba52ce33447893a Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 22 Feb 2026 20:51:18 -0500 Subject: [PATCH 088/113] Remove :ensure t remove the README.md file (Compatibility with package managers such as Staight) --- README.md | 45 ++------------------------------------------- 1 file changed, 2 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 6709326..1b408c8 100644 --- a/README.md +++ b/README.md @@ -280,7 +280,6 @@ Native compilation enhances Emacs performance by converting Elisp code into nati ;; Ensure adding the following compile-angel code at the very beginning ;; of your `~/.emacs.d/post-init.el` file, before all other packages. (use-package compile-angel - :ensure t :demand t :config ;; The following disables compilation of packages during installation; @@ -324,7 +323,6 @@ To fix this, add **exec-path-from-shell** to `~/.emacs.d/post-init.el`: (use-package exec-path-from-shell :if (and (or (display-graphic-p) (daemonp)) (eq system-type 'darwin)) ; macOS only - :ensure t :demand t :functions exec-path-from-shell-initialize :config @@ -463,7 +461,6 @@ To configure `corfu` and `cape`, add the following to `~/.emacs.d/post-init.el`: ;; current candidates, positioned either below or above the point. Candidates ;; can be selected by navigating up or down. (use-package corfu - :ensure t :commands (corfu-mode global-corfu-mode) :hook ((prog-mode . corfu-mode) @@ -485,7 +482,6 @@ To configure `corfu` and `cape`, add the following to `~/.emacs.d/post-init.el`: ;; in-buffer completion. It integrates with Corfu or the default completion UI, ;; by providing additional backends through completion-at-point-functions. (use-package cape - :ensure t :commands (cape-dabbrev cape-file cape-elisp-block) :bind ("C-c p" . cape-prefix-map) :init @@ -514,7 +510,6 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E ;; navigate and select from completion candidates (e.g., when `M-x` is pressed). (use-package vertico ;; (Note: It is recommended to also enable the savehist package.) - :ensure t :config (vertico-mode)) @@ -522,7 +517,6 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E ;; to input multiple patterns separated by spaces, which Orderless then ;; matches in any order against the candidates. (use-package orderless - :ensure t :custom (completion-styles '(orderless basic)) (completion-category-defaults nil) @@ -532,7 +526,6 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E ;; In addition to that, Marginalia also enhances Vertico by adding rich ;; annotations to the completion candidates displayed in Vertico's interface. (use-package marginalia - :ensure t :commands (marginalia-mode marginalia-cycle) :hook (after-init . marginalia-mode)) @@ -544,7 +537,6 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E ;; Embark is an Emacs package that acts like a context menu, allowing ;; users to perform context-sensitive actions on selected items ;; directly from the completion interface. - :ensure t :commands (embark-act embark-dwim embark-export @@ -567,14 +559,12 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E (window-parameters (mode-line-format . none))))) (use-package embark-consult - :ensure t :hook (embark-collect-mode . consult-preview-at-point-mode)) ;; Consult offers a suite of commands for efficient searching, previewing, and ;; interacting with buffers, file contents, and more, improving various tasks. (use-package consult - :ensure t :bind (;; C-c bindings in `mode-specific-map' ("C-c M-x" . consult-mode-command) ("C-c h" . consult-history) @@ -680,7 +670,6 @@ To install and configure these packages, add the following to `~/.emacs.d/post-i ;; The undo-fu package is a lightweight wrapper around Emacs' built-in undo ;; system, providing more convenient undo/redo functionality. (use-package undo-fu - :ensure t :commands (undo-fu-only-undo undo-fu-only-redo undo-fu-only-redo-all @@ -693,7 +682,6 @@ To install and configure these packages, add the following to `~/.emacs.d/post-i ;; The undo-fu-session package complements undo-fu by enabling the saving ;; and restoration of undo history across Emacs sessions, even after restarting. (use-package undo-fu-session - :ensure t :commands undo-fu-session-global-mode :hook (after-init . undo-fu-session-global-mode)) ``` @@ -752,7 +740,6 @@ Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency ;; Vim emulation (use-package evil - :ensure t :commands (evil-mode evil-define-key) :hook (after-init . evil-mode) @@ -793,7 +780,6 @@ Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency (use-package evil-collection :after evil - :ensure t :init ;; It has to be defined before evil-colllection (setq evil-collection-setup-minibuffer t) @@ -814,7 +800,6 @@ You can also install the [vim-tab-bar](https://github.com/jamescherti/vim-tab-ba ``` emacs-lisp ;; Give Emacs tab-bar a style similar to Vim's (use-package vim-tab-bar - :ensure t :commands vim-tab-bar-mode :hook (after-init . vim-tab-bar-mode)) ``` @@ -832,7 +817,6 @@ The `evil-surround` package simplifies handling surrounding characters, such as ;; using S" or gS". (use-package evil-surround :after evil - :ensure t :commands global-evil-surround-mode :custom (evil-surround-pairs-alist @@ -878,7 +862,6 @@ To configure **easysession**, add the following to `~/.emacs.d/post-init.el`: ;; manage Emacs editing sessions and utilizes built-in Emacs functions to ;; persist and restore frames. (use-package easysession - :ensure t :commands (easysession-switch-to easysession-save-as easysession-save-mode @@ -943,7 +926,6 @@ This configuration sets up `markdown-mode` with deferred loading to improve star ```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 @@ -1059,7 +1041,6 @@ For folding based on indentation levels, the **[outline-indent](https://github.c ;; - Move backward/forward to the indentation level of the current line ;; - and other features. (use-package outline-indent - :ensure t :commands outline-indent-minor-mode :custom @@ -1128,7 +1109,6 @@ To configure **apheleia**, add the following to `~/.emacs.d/post-init.el`: ;; Apheleia is an Emacs package designed to run code formatters (e.g., Shfmt, ;; Black and Prettier) asynchronously without disrupting the cursor position. (use-package apheleia - :ensure t :commands (apheleia-mode apheleia-global-mode) :hook ((prog-mode . apheleia-mode))) @@ -1183,7 +1163,6 @@ The [yasnippet-snippets](https://github.com/AndreaCrotti/yasnippet-snippets) pac ```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 @@ -1191,7 +1170,6 @@ The [yasnippet-snippets](https://github.com/AndreaCrotti/yasnippet-snippets) pac ;; 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) @@ -1291,7 +1269,6 @@ To enable **stripspace** and automatically delete trailing whitespace, add the f ;; that automatically removes trailing whitespace and blank lines at the end of ;; the buffer when saving. (use-package stripspace - :ensure t :commands stripspace-local-mode ;; Enable for prog-mode-hook, text-mode-hook, conf-mode-hook @@ -1346,7 +1323,6 @@ To configure **org-mode**, add the following to `~/.emacs.d/post-init.el`: ;; scheduling, deadlines, time tracking, and exporting to multiple formats ;; including HTML, LaTeX, PDF, and Markdown. (use-package org - :ensure t :commands (org-mode org-version) :mode ("\\.org\\'" . org-mode) @@ -1416,7 +1392,6 @@ To configure **auto-package-update**, add the following to `~/.emacs.d/post-init ```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 @@ -1461,7 +1436,6 @@ To configure **buffer-terminator**, add the following to `~/.emacs.d/post-init.e ```emacs-lisp (use-package buffer-terminator - :ensure t :custom ;; Enable/Disable verbose mode to log buffer cleanup events (buffer-terminator-verbose nil) @@ -1493,7 +1467,6 @@ To configure **treemacs**, add the following to `~/.emacs.d/post-init.el`: ;; in the left window, providing a persistent view of files, projects, and ;; other elements. (use-package treemacs - :ensure t :commands (treemacs treemacs-select-window treemacs-delete-other-windows @@ -1592,16 +1565,13 @@ To configure **treemacs**, add the following to `~/.emacs.d/post-init.el`: (treemacs-hide-gitignored-files-mode nil)) ;; (use-package treemacs-evil -;; :after (treemacs evil) -;; :ensure t) +;; :after (treemacs evil)) ;; ;; (use-package treemacs-icons-dired -;; :hook (dired-mode . treemacs-icons-dired-enable-once) -;; :ensure t) +;; :hook (dired-mode . treemacs-icons-dired-enable-once)) ;; ;; (use-package treemacs-tab-bar ; treemacs-tab-bar if you use tab-bar-mode ;; :after (treemacs) -;; :ensure t ;; :config (treemacs-set-scope-type 'Tabs)) ;; ;; (treemacs-start-on-boot) @@ -1616,7 +1586,6 @@ To configure **helpful**, add the following to `~/.emacs.d/post-init.el`: ;; Helpful is an alternative to the built-in Emacs help that provides much more ;; contextual information. (use-package helpful - :ensure t :commands (helpful-callable helpful-variable helpful-key @@ -1642,7 +1611,6 @@ It operates by generating a dynamic, temporary mapping: upon invocation, such as 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) @@ -1664,7 +1632,6 @@ The functions above also ensures that any modified buffers are saved prior to ex To configure **bufferfile**, add the following to `~/.emacs.d/post-init.el`: ```elisp (use-package bufferfile - :ensure t :commands (bufferfile-copy bufferfile-rename bufferfile-delete) @@ -1692,14 +1659,12 @@ To enhance the Elisp development experience, add the following to `~/.emacs.d/po ```emacs-lisp ;; Enables automatic indentation of code while typing (use-package aggressive-indent - :ensure t :commands aggressive-indent-mode :hook (emacs-lisp-mode . aggressive-indent-mode)) ;; Highlights function and variable definitions in Emacs Lisp mode (use-package highlight-defined - :ensure t :commands highlight-defined-mode :hook (emacs-lisp-mode . highlight-defined-mode)) @@ -1709,7 +1674,6 @@ Other optional packages that may be useful include: ```emacs-lisp ;; Prevent parenthesis imbalance (use-package paredit - :ensure t :commands paredit-mode :hook (emacs-lisp-mode . paredit-mode) @@ -1719,14 +1683,12 @@ Other optional packages that may be useful include: ;; For paredit+Evil mode users: enhances paredit with Evil mode compatibility ;; -------------------------------------------------------------------------- ;; (use-package enhanced-evil-paredit -;; :ensure t ;; :commands enhanced-evil-paredit-mode ;; :hook ;; (paredit-mode . enhanced-evil-paredit-mode)) ;; Displays visible indicators for page breaks (use-package page-break-lines - :ensure t :commands (page-break-lines-mode global-page-break-lines-mode) :hook @@ -1735,7 +1697,6 @@ Other optional packages that may be useful include: ;; Provides functions to find references to functions, macros, variables, ;; special forms, and symbols in Emacs Lisp (use-package elisp-refs - :ensure t :commands (elisp-refs-function elisp-refs-macro elisp-refs-variable @@ -1759,7 +1720,6 @@ To configure **inhibit-mouse**, add the following to `~/.emacs.d/post-init.el`: ;; - Reinforce a keyboard-centric workflow by discouraging reliance on the mouse ;; for navigation. (use-package inhibit-mouse - :ensure t :config (if (daemonp) (add-hook 'server-after-make-frame-hook #'inhibit-mouse-mode) @@ -1787,7 +1747,6 @@ To enable *quick-sdcv*, add the following to your `~/.emacs.d/post-init.el`: ```emacs-lisp (use-package quick-sdcv - :ensure t :custom (quick-sdcv-unique-buffers t) (quick-sdcv-dictionary-prefix-symbol "►") From c917cd25824dff280063b8d3d13d64f798380c82 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 22 Feb 2026 20:52:07 -0500 Subject: [PATCH 089/113] Set use-package-expand-minimally to t --- early-init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/early-init.el b/early-init.el index 9c73222..358ba5a 100644 --- a/early-init.el +++ b/early-init.el @@ -451,7 +451,7 @@ this stage of initialization." (setq gnutls-min-prime-bits 3072) ; Stronger GnuTLS encryption ;; This results in a more compact output that emphasizes performance -(setq use-package-expand-minimally (not noninteractive)) +(setq use-package-expand-minimally t) (setq use-package-minimum-reported-time (if minimal-emacs-debug 0 0.1)) (setq use-package-verbose minimal-emacs-debug) From 40a9131f6652962aff3412455e0c157e814ce091 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 23 Feb 2026 09:39:35 -0500 Subject: [PATCH 090/113] Change use-package-always-ensure to (not noninteractive) --- early-init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/early-init.el b/early-init.el index 358ba5a..89eba07 100644 --- a/early-init.el +++ b/early-init.el @@ -455,7 +455,7 @@ this stage of initialization." (setq use-package-minimum-reported-time (if minimal-emacs-debug 0 0.1)) (setq use-package-verbose minimal-emacs-debug) -(setq use-package-always-ensure t) +(setq use-package-always-ensure (not noninteractive)) (setq use-package-enable-imenu-support t) ;; package.el From c3d7b5ecee6057a6fb90047fa411e1b7622b1b98 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 24 Feb 2026 15:26:06 -0500 Subject: [PATCH 091/113] Add byte-compile-current-file check to package management --- init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/init.el b/init.el index d8205bb..e00ed36 100644 --- a/init.el +++ b/init.el @@ -47,6 +47,7 @@ ;;; package.el (when (and (bound-and-true-p minimal-emacs-package-initialize-and-refresh) + (not (bound-and-true-p byte-compile-current-file)) (not (or (fboundp 'straight-use-package) (fboundp 'elpaca)))) ;; Initialize and refresh package contents again if needed From e384055417510ef80ef6dbd5fbfd2a26c6cb567d Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 24 Feb 2026 16:05:23 -0500 Subject: [PATCH 092/113] Revert "Remove :ensure t remove the README.md file" This reverts commit 1b4bf18a2d621f608e6e2c2f0ba52ce33447893a. --- README.md | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1b408c8..6709326 100644 --- a/README.md +++ b/README.md @@ -280,6 +280,7 @@ Native compilation enhances Emacs performance by converting Elisp code into nati ;; Ensure adding the following compile-angel code at the very beginning ;; of your `~/.emacs.d/post-init.el` file, before all other packages. (use-package compile-angel + :ensure t :demand t :config ;; The following disables compilation of packages during installation; @@ -323,6 +324,7 @@ To fix this, add **exec-path-from-shell** to `~/.emacs.d/post-init.el`: (use-package exec-path-from-shell :if (and (or (display-graphic-p) (daemonp)) (eq system-type 'darwin)) ; macOS only + :ensure t :demand t :functions exec-path-from-shell-initialize :config @@ -461,6 +463,7 @@ To configure `corfu` and `cape`, add the following to `~/.emacs.d/post-init.el`: ;; current candidates, positioned either below or above the point. Candidates ;; can be selected by navigating up or down. (use-package corfu + :ensure t :commands (corfu-mode global-corfu-mode) :hook ((prog-mode . corfu-mode) @@ -482,6 +485,7 @@ To configure `corfu` and `cape`, add the following to `~/.emacs.d/post-init.el`: ;; in-buffer completion. It integrates with Corfu or the default completion UI, ;; by providing additional backends through completion-at-point-functions. (use-package cape + :ensure t :commands (cape-dabbrev cape-file cape-elisp-block) :bind ("C-c p" . cape-prefix-map) :init @@ -510,6 +514,7 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E ;; navigate and select from completion candidates (e.g., when `M-x` is pressed). (use-package vertico ;; (Note: It is recommended to also enable the savehist package.) + :ensure t :config (vertico-mode)) @@ -517,6 +522,7 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E ;; to input multiple patterns separated by spaces, which Orderless then ;; matches in any order against the candidates. (use-package orderless + :ensure t :custom (completion-styles '(orderless basic)) (completion-category-defaults nil) @@ -526,6 +532,7 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E ;; In addition to that, Marginalia also enhances Vertico by adding rich ;; annotations to the completion candidates displayed in Vertico's interface. (use-package marginalia + :ensure t :commands (marginalia-mode marginalia-cycle) :hook (after-init . marginalia-mode)) @@ -537,6 +544,7 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E ;; Embark is an Emacs package that acts like a context menu, allowing ;; users to perform context-sensitive actions on selected items ;; directly from the completion interface. + :ensure t :commands (embark-act embark-dwim embark-export @@ -559,12 +567,14 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E (window-parameters (mode-line-format . none))))) (use-package embark-consult + :ensure t :hook (embark-collect-mode . consult-preview-at-point-mode)) ;; Consult offers a suite of commands for efficient searching, previewing, and ;; interacting with buffers, file contents, and more, improving various tasks. (use-package consult + :ensure t :bind (;; C-c bindings in `mode-specific-map' ("C-c M-x" . consult-mode-command) ("C-c h" . consult-history) @@ -670,6 +680,7 @@ To install and configure these packages, add the following to `~/.emacs.d/post-i ;; The undo-fu package is a lightweight wrapper around Emacs' built-in undo ;; system, providing more convenient undo/redo functionality. (use-package undo-fu + :ensure t :commands (undo-fu-only-undo undo-fu-only-redo undo-fu-only-redo-all @@ -682,6 +693,7 @@ To install and configure these packages, add the following to `~/.emacs.d/post-i ;; The undo-fu-session package complements undo-fu by enabling the saving ;; and restoration of undo history across Emacs sessions, even after restarting. (use-package undo-fu-session + :ensure t :commands undo-fu-session-global-mode :hook (after-init . undo-fu-session-global-mode)) ``` @@ -740,6 +752,7 @@ Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency ;; Vim emulation (use-package evil + :ensure t :commands (evil-mode evil-define-key) :hook (after-init . evil-mode) @@ -780,6 +793,7 @@ Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency (use-package evil-collection :after evil + :ensure t :init ;; It has to be defined before evil-colllection (setq evil-collection-setup-minibuffer t) @@ -800,6 +814,7 @@ You can also install the [vim-tab-bar](https://github.com/jamescherti/vim-tab-ba ``` emacs-lisp ;; Give Emacs tab-bar a style similar to Vim's (use-package vim-tab-bar + :ensure t :commands vim-tab-bar-mode :hook (after-init . vim-tab-bar-mode)) ``` @@ -817,6 +832,7 @@ The `evil-surround` package simplifies handling surrounding characters, such as ;; using S" or gS". (use-package evil-surround :after evil + :ensure t :commands global-evil-surround-mode :custom (evil-surround-pairs-alist @@ -862,6 +878,7 @@ To configure **easysession**, add the following to `~/.emacs.d/post-init.el`: ;; manage Emacs editing sessions and utilizes built-in Emacs functions to ;; persist and restore frames. (use-package easysession + :ensure t :commands (easysession-switch-to easysession-save-as easysession-save-mode @@ -926,6 +943,7 @@ This configuration sets up `markdown-mode` with deferred loading to improve star ```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 @@ -1041,6 +1059,7 @@ For folding based on indentation levels, the **[outline-indent](https://github.c ;; - Move backward/forward to the indentation level of the current line ;; - and other features. (use-package outline-indent + :ensure t :commands outline-indent-minor-mode :custom @@ -1109,6 +1128,7 @@ To configure **apheleia**, add the following to `~/.emacs.d/post-init.el`: ;; Apheleia is an Emacs package designed to run code formatters (e.g., Shfmt, ;; Black and Prettier) asynchronously without disrupting the cursor position. (use-package apheleia + :ensure t :commands (apheleia-mode apheleia-global-mode) :hook ((prog-mode . apheleia-mode))) @@ -1163,6 +1183,7 @@ The [yasnippet-snippets](https://github.com/AndreaCrotti/yasnippet-snippets) pac ```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 @@ -1170,6 +1191,7 @@ The [yasnippet-snippets](https://github.com/AndreaCrotti/yasnippet-snippets) pac ;; 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) @@ -1269,6 +1291,7 @@ To enable **stripspace** and automatically delete trailing whitespace, add the f ;; that automatically removes trailing whitespace and blank lines at the end of ;; the buffer when saving. (use-package stripspace + :ensure t :commands stripspace-local-mode ;; Enable for prog-mode-hook, text-mode-hook, conf-mode-hook @@ -1323,6 +1346,7 @@ To configure **org-mode**, add the following to `~/.emacs.d/post-init.el`: ;; scheduling, deadlines, time tracking, and exporting to multiple formats ;; including HTML, LaTeX, PDF, and Markdown. (use-package org + :ensure t :commands (org-mode org-version) :mode ("\\.org\\'" . org-mode) @@ -1392,6 +1416,7 @@ To configure **auto-package-update**, add the following to `~/.emacs.d/post-init ```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 @@ -1436,6 +1461,7 @@ To configure **buffer-terminator**, add the following to `~/.emacs.d/post-init.e ```emacs-lisp (use-package buffer-terminator + :ensure t :custom ;; Enable/Disable verbose mode to log buffer cleanup events (buffer-terminator-verbose nil) @@ -1467,6 +1493,7 @@ To configure **treemacs**, add the following to `~/.emacs.d/post-init.el`: ;; in the left window, providing a persistent view of files, projects, and ;; other elements. (use-package treemacs + :ensure t :commands (treemacs treemacs-select-window treemacs-delete-other-windows @@ -1565,13 +1592,16 @@ To configure **treemacs**, add the following to `~/.emacs.d/post-init.el`: (treemacs-hide-gitignored-files-mode nil)) ;; (use-package treemacs-evil -;; :after (treemacs evil)) +;; :after (treemacs evil) +;; :ensure t) ;; ;; (use-package treemacs-icons-dired -;; :hook (dired-mode . treemacs-icons-dired-enable-once)) +;; :hook (dired-mode . treemacs-icons-dired-enable-once) +;; :ensure t) ;; ;; (use-package treemacs-tab-bar ; treemacs-tab-bar if you use tab-bar-mode ;; :after (treemacs) +;; :ensure t ;; :config (treemacs-set-scope-type 'Tabs)) ;; ;; (treemacs-start-on-boot) @@ -1586,6 +1616,7 @@ To configure **helpful**, add the following to `~/.emacs.d/post-init.el`: ;; Helpful is an alternative to the built-in Emacs help that provides much more ;; contextual information. (use-package helpful + :ensure t :commands (helpful-callable helpful-variable helpful-key @@ -1611,6 +1642,7 @@ It operates by generating a dynamic, temporary mapping: upon invocation, such as 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) @@ -1632,6 +1664,7 @@ The functions above also ensures that any modified buffers are saved prior to ex To configure **bufferfile**, add the following to `~/.emacs.d/post-init.el`: ```elisp (use-package bufferfile + :ensure t :commands (bufferfile-copy bufferfile-rename bufferfile-delete) @@ -1659,12 +1692,14 @@ To enhance the Elisp development experience, add the following to `~/.emacs.d/po ```emacs-lisp ;; Enables automatic indentation of code while typing (use-package aggressive-indent + :ensure t :commands aggressive-indent-mode :hook (emacs-lisp-mode . aggressive-indent-mode)) ;; Highlights function and variable definitions in Emacs Lisp mode (use-package highlight-defined + :ensure t :commands highlight-defined-mode :hook (emacs-lisp-mode . highlight-defined-mode)) @@ -1674,6 +1709,7 @@ Other optional packages that may be useful include: ```emacs-lisp ;; Prevent parenthesis imbalance (use-package paredit + :ensure t :commands paredit-mode :hook (emacs-lisp-mode . paredit-mode) @@ -1683,12 +1719,14 @@ Other optional packages that may be useful include: ;; For paredit+Evil mode users: enhances paredit with Evil mode compatibility ;; -------------------------------------------------------------------------- ;; (use-package enhanced-evil-paredit +;; :ensure t ;; :commands enhanced-evil-paredit-mode ;; :hook ;; (paredit-mode . enhanced-evil-paredit-mode)) ;; Displays visible indicators for page breaks (use-package page-break-lines + :ensure t :commands (page-break-lines-mode global-page-break-lines-mode) :hook @@ -1697,6 +1735,7 @@ Other optional packages that may be useful include: ;; Provides functions to find references to functions, macros, variables, ;; special forms, and symbols in Emacs Lisp (use-package elisp-refs + :ensure t :commands (elisp-refs-function elisp-refs-macro elisp-refs-variable @@ -1720,6 +1759,7 @@ To configure **inhibit-mouse**, add the following to `~/.emacs.d/post-init.el`: ;; - Reinforce a keyboard-centric workflow by discouraging reliance on the mouse ;; for navigation. (use-package inhibit-mouse + :ensure t :config (if (daemonp) (add-hook 'server-after-make-frame-hook #'inhibit-mouse-mode) @@ -1747,6 +1787,7 @@ To enable *quick-sdcv*, add the following to your `~/.emacs.d/post-init.el`: ```emacs-lisp (use-package quick-sdcv + :ensure t :custom (quick-sdcv-unique-buffers t) (quick-sdcv-dictionary-prefix-symbol "►") From 9ea9d4eb513c2e2168583b64f985036ab8bb8534 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 24 Feb 2026 22:39:00 -0500 Subject: [PATCH 093/113] Fix daemon startup optimizations and buffer initialization - Remove (not (daemonp)) checks from early-init.el performance blocks. This allows Emacs to properly optimize file name handlers, UI rendering suppression, and frame resizing when starting as a background server. - Move initial-major-mode and initial-scratch-message from early-init.el to init.el to prevent silent overwrites by custom.el. - Move default-input-method to init.el. --- early-init.el | 22 ++-------------------- init.el | 13 +++++++++++++ 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/early-init.el b/early-init.el index 89eba07..0fcf5e8 100644 --- a/early-init.el +++ b/early-init.el @@ -194,9 +194,6 @@ pre-early-init.el, and post-early-init.el.") (set-language-environment "UTF-8") -;; Set-language-environment sets default-input-method, which is unwanted. -(setq default-input-method nil) - ;; Increase how much is read from processes in a single chunk (setq read-process-output-max (* 2 1024 1024)) ; 1024kb @@ -225,7 +222,7 @@ pre-early-init.el, and post-early-init.el.") ;; icon fonts on Windows. This will increase memory usage. (setq inhibit-compacting-font-caches t) -(when (and (not (daemonp)) (not noninteractive)) +(when (not noninteractive) ;; Resizing the Emacs frame can be costly when changing the font. Disable this ;; to improve startup times with fonts larger than the system default. (setq frame-resize-pixelwise t) @@ -259,16 +256,6 @@ pre-early-init.el, and post-early-init.el.") ;; `inhibit-startup-screen', but it would still initialize anyway. (advice-add 'display-startup-screen :override #'ignore) - ;; The initial buffer is created during startup even in non-interactive - ;; sessions, and its major mode is fully initialized. Modes like `text-mode', - ;; `org-mode', or even the default `lisp-interaction-mode' load extra packages - ;; and run hooks, which can slow down startup. - ;; - ;; Using `fundamental-mode' for the initial buffer to avoid unnecessary - ;; startup overhead. - (setq initial-major-mode 'fundamental-mode - initial-scratch-message nil) - (unless minimal-emacs-debug ;; Unset command line options irrelevant to the current OS. These options ;; are still processed by `command-line-1` but have no effect. @@ -302,7 +289,6 @@ this stage of initialization." minimal-emacs--old-file-name-handler-alist)))) (when (and minimal-emacs-optimize-file-name-handler-alist - (not (daemonp)) (not minimal-emacs-debug)) ;; Determine the state of bundled libraries using calc-loaddefs.el. If ;; compressed, retain the gzip handler in `file-name-handler-alist`. If @@ -334,7 +320,6 @@ this stage of initialization." (remove-hook 'post-command-hook #'minimal-emacs--reset-inhibit-redisplay)) (when (and minimal-emacs-inhibit-redisplay-during-startup - (not (daemonp)) (not noninteractive) (not minimal-emacs-debug)) ;; Suppress redisplay and redraw during startup to avoid delays and @@ -350,7 +335,6 @@ this stage of initialization." (remove-hook 'post-command-hook #'minimal-emacs--reset-inhibit-message)) (when (and minimal-emacs-inhibit-message-during-startup - (not (daemonp)) (not noninteractive) (not minimal-emacs-debug)) (setq-default inhibit-message t) @@ -359,7 +343,6 @@ this stage of initialization." ;;; Performance: Disable mode-line during startup (when (and minimal-emacs-disable-mode-line-during-startup - (not (daemonp)) (not noninteractive) (not minimal-emacs-debug)) (put 'mode-line-format @@ -416,8 +399,7 @@ this stage of initialization." (when (bound-and-true-p tool-bar-mode) (funcall 'tool-bar-setup)))) -(when (and (not (daemonp)) - (not noninteractive)) +(unless noninteractive (when (fboundp 'tool-bar-setup) ;; Temporarily override the tool-bar-setup function to prevent it from ;; running during the initial stages of startup diff --git a/init.el b/init.el index e00ed36..1da9551 100644 --- a/init.el +++ b/init.el @@ -28,6 +28,19 @@ ;;; Before package +;; The initial buffer is created during startup even in non-interactive +;; sessions, and its major mode is fully initialized. Modes like `text-mode', +;; `org-mode', or even the default `lisp-interaction-mode' load extra packages +;; and run hooks, which can slow down startup. +;; +;; Using `fundamental-mode' for the initial buffer to avoid unnecessary +;; startup overhead. +(setq initial-major-mode 'fundamental-mode + initial-scratch-message nil) + +;; Set-language-environment sets default-input-method, which is unwanted. +(setq default-input-method nil) + ;; 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) From 41424f2ece869e9c17f47c02779c9ce147ff5ce3 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:11:32 -0500 Subject: [PATCH 094/113] Add vars to disable loading pre/post early-init/init files --- README.md | 8 ++++++++ early-init.el | 19 +++++++++++++++++-- init.el | 11 ++++++++--- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6709326..f0a8002 100644 --- a/README.md +++ b/README.md @@ -2098,6 +2098,14 @@ These modes are optional and can be added selectively to `~/.emacs.d/post-init.e ("/info/attributes\\'" . gitattributes-mode) ("/git/attributes\\'" . gitattributes-mode))) +;; Configure built-in sgml-mode to automatically enable +;; `sgml-electric-tag-pair-mode' in `html-mode' and `mhtml-mode', providing +;; automatic insertion of matching closing tags. +(use-package sgml-mode + :ensure nil + :commands (sgml-mode sgml-electric-tag-pair-mode) + :hook ((html-mode mhtml-mode) . sgml-electric-tag-pair-mode)) + ;; Support for YAML files. ;; ;; NOTE: Prefer the tree-sitter-based yaml-ts-mode over yaml-mode when diff --git a/early-init.el b/early-init.el index 0fcf5e8..79a98fb 100644 --- a/early-init.el +++ b/early-init.el @@ -95,6 +95,18 @@ of the progress or any relevant activities during startup.") "Directory beneath minimal-emacs.d files are placed. Note that this should end with a directory separator.") +(defvar minimal-emacs-load-pre-early-init t + "If non-nil, attempt to load `pre-early-init.el`.") + +(defvar minimal-emacs-load-post-early-init t + "If non-nil, attempt to load `post-early-init.el`.") + +(defvar minimal-emacs-load-pre-init t + "If non-nil, attempt to load `pre-init.el`.") + +(defvar minimal-emacs-load-post-init t + "If non-nil, attempt to load `post-init.el`.") + ;;; Load pre-early-init.el ;; Prefer loading newer compiled files @@ -143,7 +155,8 @@ pre-early-init.el, and post-early-init.el.") (setq init-file (minimal-emacs--remove-el-file-suffix init-file)) (load init-file :no-error (not minimal-emacs-debug))))) -(minimal-emacs-load-user-init "pre-early-init.el") +(when minimal-emacs-load-pre-early-init + (minimal-emacs-load-user-init "pre-early-init.el")) (setq custom-theme-directory (expand-file-name "themes/" minimal-emacs-user-directory)) @@ -454,7 +467,9 @@ this stage of initialization." ("melpa-stable" . 50))) ;;; Load post-early-init.el -(minimal-emacs-load-user-init "post-early-init.el") + +(when minimal-emacs-load-post-early-init + (minimal-emacs-load-user-init "post-early-init.el")) ;; Local variables: ;; byte-compile-warnings: (not obsolete free-vars) diff --git a/init.el b/init.el index 1da9551..5d21b9f 100644 --- a/init.el +++ b/init.el @@ -22,9 +22,11 @@ ;;; Code: ;;; Load pre-init.el + (if (fboundp 'minimal-emacs-load-user-init) - (minimal-emacs-load-user-init "pre-init.el") - (error "The early-init.el file failed to loaded")) + (when minimal-emacs-load-pre-init + (minimal-emacs-load-user-init "pre-init.el")) + (error "The early-init.el file failed to load")) ;;; Before package @@ -562,8 +564,11 @@ (put cmd 'disabled nil)) ;;; Load post init -(when (fboundp 'minimal-emacs-load-user-init) + +(when (and minimal-emacs-load-post-init + (fboundp 'minimal-emacs-load-user-init)) (minimal-emacs-load-user-init "post-init.el")) + (setq minimal-emacs--success t) ;; Local variables: From 9006683e4f57794c3d74bf1c5db0a3fc5fd13458 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 10 Mar 2026 13:45:13 -0400 Subject: [PATCH 095/113] Update README.md --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f0a8002..a13b59a 100644 --- a/README.md +++ b/README.md @@ -703,8 +703,11 @@ To install and configure these packages, add the following to `~/.emacs.d/post-i For instance, to switch to a another theme than the default one, add the following to the `~/.emacs.d/post-init.el` file: ```emacs-lisp -(mapc #'disable-theme custom-enabled-themes) ; Disable all active themes -(load-theme 'modus-operandi t) ; Load the built-in theme +(let ((inhibit-redisplay t)) + ;; Disable all active themes + (mapc #'disable-theme custom-enabled-themes) + ;; Load the built-in theme + (load-theme 'modus-operandi t)) ``` (If you prefer dark themes, replace `modus-operandi` with `modus-vivendi`.) From 5b1e7ee1baca2d1928cc33b212199c0fd53abf78 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Thu, 12 Mar 2026 23:59:21 -0400 Subject: [PATCH 096/113] Refresh packages the first time Emacs is executed --- init.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/init.el b/init.el index 5d21b9f..5953f82 100644 --- a/init.el +++ b/init.el @@ -67,11 +67,11 @@ (fboundp 'elpaca)))) ;; Initialize and refresh package contents again if needed (package-initialize) - (when (version< emacs-version "29.1") - (unless (package-installed-p 'use-package) - (unless package-archive-contents - (package-refresh-contents)) - (package-install 'use-package))) + (unless package-archive-contents + (package-refresh-contents)) + (when (and (version< emacs-version "29.1") + (package-installed-p 'use-package)) + (package-install 'use-package)) (require 'use-package)) ;;; Minibuffer From d6e6c917e1ae774f7062c15b521e2b831604002a Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 13 Mar 2026 00:00:22 -0400 Subject: [PATCH 097/113] Refresh packages the first time Emacs is executed --- init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.el b/init.el index 5953f82..4a0373b 100644 --- a/init.el +++ b/init.el @@ -70,7 +70,7 @@ (unless package-archive-contents (package-refresh-contents)) (when (and (version< emacs-version "29.1") - (package-installed-p 'use-package)) + (not (package-installed-p 'use-package))) (package-install 'use-package)) (require 'use-package)) From 85b5d54b38c25effee4d443564b0aac8bdb06b42 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 13 Mar 2026 08:42:32 -0400 Subject: [PATCH 098/113] Release: 1.4.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 79a98fb..0dcb7d3 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.3.1 +;; Version: 1.4.0 ;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Commentary: diff --git a/init.el b/init.el index 4a0373b..fc8b058 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.3.1 +;; Version: 1.4.0 ;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Commentary: From 255f41e2695a39a58c2573f2496f40eaafcd427d Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 13 Mar 2026 09:53:59 -0400 Subject: [PATCH 099/113] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a13b59a..dbc93bf 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ ## Introduction -The **minimal-emacs.d** project is a **fast and lightweight** Emacs base (`init.el` and `early-init.el`) that **gives you full control over your configuration**. It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup. +The **minimal-emacs.d** project is a **fast and lightweight** minimal Emacs starter kit (`init.el` and `early-init.el`) that **gives you full control over your configuration**. It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup. -In just a few minutes of applying what's in this README.md file, you will possess a fully functional, high-performance Emacs configuration ready for work. You will bypass hours of configuration and the heavy overhead of frameworks like Doom or Spacemacs, gaining immediate access to a foundation featuring optimized garbage collection, sensible UI defaults, and a fast startup. +In just a few minutes of applying what's in this README.md file, you will have a fully functional, high-performance Emacs configuration ready for work. You will bypass hours of configuration and the heavy overhead of frameworks like Doom or Spacemacs, gaining access to optimized garbage collection, sensible UI defaults, and a fast startup. If this helps your workflow, please show your support by **⭐ starring minimal-emacs.d on GitHub** to help more Emacs users discover its benefits. From e5eaabadb7fe6fbb3b4d36d5d246277e4e68254c Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 13 Mar 2026 11:07:08 -0400 Subject: [PATCH 100/113] Update CLI settings, auto-save, and backup --- README.md | 2 +- init.el | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index dbc93bf..c4f4763 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The **minimal-emacs.d** project is a **fast and lightweight** minimal Emacs starter kit (`init.el` and `early-init.el`) that **gives you full control over your configuration**. It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup. -In just a few minutes of applying what's in this README.md file, you will have a fully functional, high-performance Emacs configuration ready for work. You will bypass hours of configuration and the heavy overhead of frameworks like Doom or Spacemacs, gaining access to optimized garbage collection, sensible UI defaults, and a fast startup. +In just a few minutes of applying what's in this README.md file, you will have a fully functional, high-performance Emacs configuration ready for work. You will bypass hours of configuration and the heavy overhead of frameworks like Doom or Spacemacs, gaining access to optimized garbage collection, sensible defaults, and a fast startup. If this helps your workflow, please show your support by **⭐ starring minimal-emacs.d on GitHub** to help more Emacs users discover its benefits. diff --git a/init.el b/init.el index fc8b058..b7c5ab5 100644 --- a/init.el +++ b/init.el @@ -197,8 +197,16 @@ ;;; Backup files -;; Avoid backups or lockfiles to prevent creating world-readable copies of files +;; Disable the creation of lockfiles (e.g., .#filename). +;; Modern workflows rely on `global-auto-revert-mode' to handle external file +;; changes gracefully, making the restrictive nature of lockfiles unnecessary. (setq create-lockfiles nil) + +;; Disable backup files (e.g., filename~). Note that `auto-save-default' +;; remains enabled by default. Even with `make-backup-files' backups disabled, +;; Emacs will still generate temporary recovery files (e.g., #filename#) for +;; unsaved buffers. This protects your active work from sudden crashes while +;; ensuring the file system is cleaned up immediately upon a successful save. (setq make-backup-files nil) (setq backup-directory-alist @@ -214,7 +222,6 @@ ;;; VC (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. ;;; Auto save @@ -222,9 +229,14 @@ ;; Enable auto-save to safeguard against crashes or data loss. The ;; `recover-file' or `recover-session' functions can be used to restore ;; auto-saved data. -(setq auto-save-default nil) +(setq auto-save-default t) (setq auto-save-no-message t) +(when noninteractive + ;; The command line interface + (setq enable-dir-local-variables nil) + (setq case-fold-search nil)) + ;; Do not auto-disable auto-save after deleting large chunks of ;; text. (setq auto-save-include-big-deletions t) From 683803e8adf24d98cce2ab5a86cb2ecba5b314d0 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 13 Mar 2026 12:17:48 -0400 Subject: [PATCH 101/113] Add auto-save-file-name-transforms and create the auto-save-list-file-prefix dir --- README.md | 3 +++ init.el | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c4f4763..4a3ff8a 100644 --- a/README.md +++ b/README.md @@ -425,7 +425,10 @@ To enable autosave, add the following to `~/.emacs.d/post-init.el`: ;; `recover-session' to restore unsaved changes. (setq auto-save-default t) +;; Trigger an auto-save after 300 keystrokes (setq auto-save-interval 300) + +;; Trigger an auto-save 30 seconds of idle time. (setq auto-save-timeout 30) ``` diff --git a/init.el b/init.el index b7c5ab5..acb73f4 100644 --- a/init.el +++ b/init.el @@ -229,7 +229,6 @@ ;; Enable auto-save to safeguard against crashes or data loss. The ;; `recover-file' or `recover-session' functions can be used to restore ;; auto-saved data. -(setq auto-save-default t) (setq auto-save-no-message t) (when noninteractive @@ -246,6 +245,20 @@ (setq tramp-auto-save-directory (expand-file-name "tramp-autosave/" user-emacs-directory)) +(setq auto-save-file-name-transforms + `(("\\`/[^/]*:\\([^/]*/\\)*\\([^/]*\\)\\'" + ,(file-name-concat auto-save-list-file-prefix "tramp-\\2-") sha1) + ("\\`/\\([^/]+/\\)*\\([^/]+\\)\\'" + ,(file-name-concat auto-save-list-file-prefix "\\2-") sha1))) + +;; Ensure the directory for auto-save session logs exists with restricted +;; permissions. +(when auto-save-default + (let ((auto-save-dir (file-name-directory auto-save-list-file-prefix))) + (unless (file-exists-p auto-save-dir) + (with-file-modes #o700 + (make-directory auto-save-dir t))))) + ;; Auto save options (setq kill-buffer-delete-auto-save-files t) From 6318555b3f62c982f72d67ddadebcea1d052b8e8 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 13 Mar 2026 14:10:19 -0400 Subject: [PATCH 102/113] Update README.md --- README.md | 98 ++++++++++++++++++++++++++++++++++--------------------- init.el | 6 ++-- 2 files changed, 64 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 4a3ff8a..c575bfd 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ The **minimal-emacs.d** project is a **fast and lightweight** minimal Emacs starter kit (`init.el` and `early-init.el`) that **gives you full control over your configuration**. It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup. +Each setting in minimal-emacs.d is carefully chosen to answer this question: does it provide a better default that modernizes Emacs while keeping it lightweight, fast and stable? + In just a few minutes of applying what's in this README.md file, you will have a fully functional, high-performance Emacs configuration ready for work. You will bypass hours of configuration and the heavy overhead of frameworks like Doom or Spacemacs, gaining access to optimized garbage collection, sensible defaults, and a fast startup. If this helps your workflow, please show your support by **⭐ starring minimal-emacs.d on GitHub** to help more Emacs users discover its benefits. @@ -156,6 +158,14 @@ Please share your configuration. It could serve as inspiration for other users. - [How to make *minimal-emacs.d* install packages in the early-init phase instead of the init phase?](#how-to-make-minimal-emacsd-install-packages-in-the-early-init-phase-instead-of-the-init-phase) - [Minimal-emacs.d configurations from users](#minimal-emacsd-configurations-from-users) - [Features](#features) + - [Fast Initialization and Performance](#fast-initialization-and-performance) + - [Native Compilation and Byte Compilation](#native-compilation-and-byte-compilation) + - [Interface Defaults](#interface-defaults) + - [Package and File Management](#package-and-file-management) + - [Precision Editing and UX Enhancements](#precision-editing-and-ux-enhancements) + - [Developer Experience](#developer-experience) + - [Buffer, Directory, and Window Management](#buffer-directory-and-window-management) + - [Security, Stability, and Customizable Initialization](#security-stability-and-customizable-initialization) - [Author and license](#author-and-license) - [Links](#links) @@ -215,7 +225,7 @@ Always begin your `pre-init.el`, `post-init.el`, `post-early-init.el`, and `pre- Replace `FILENAME.el` with the actual name and DESCRIPTION with a brief description of its purpose. -*(Only if you know what you're doing: Removing `no-byte-compile: t;` from your init files allows Emacs to compile them, improving load and execution speed. However, if you do so, you may need to add required dependencies. For example, if you're using `use-package`, add `(require 'use-package)` at the top of `post-init.el` to ensure all necessary `use-package` variables and functions are loaded.)* +*(Only if you know what you're doing: Removing `no-byte-compile: t;` from your init files allows Emacs to compile them, improving load and execution speed. However, if you do so, you may need to add required dependencies. For example, if you're using `use-package`, add `(require 'use-package)` at the top of `post-init.el` to ensure all necessary `use-package` variables and functions are loaded. **The only init file where `no-byte-compile: t` should never be removed is `early-init.el`**, because if this file is compiled, Emacs may load an outdated compiled version.)* **Important:** The examples in this README reference pre/post init files in the `~/.emacs.d/` directory, but the files `pre-early-init.el`, `post-early-init.el`, `pre-init.el`, and `post-init.el` should be placed in the same directory as `init.el` and `early-init.el`, regardless of their location. @@ -2480,9 +2490,7 @@ Here is a comprehensive `package-pinned-packages` configuration to guarantee tha (vertico-prescient . "melpa-stable") (visual-fill-column . "melpa-stable") (yasnippet-snippets . "melpa-stable") - (ace-window . "gnu") (aggressive-indent . "gnu") - (avy . "gnu") (cape . "gnu") (compat . "gnu") (consult . "gnu") @@ -2733,49 +2741,63 @@ To install and load packages during the early-init phase, add the following to ` ## Features -1. **Performance Improvements:** - - Increases the amount read from processes in a single chunk. - - Prefers loading newer compiled files. - - Reduces startup screen and message noise, including removing the "For information about GNU Emacs..." message. - - Configures Emacs to start with a scratch buffer in `fundamental-mode` to shave seconds off startup time. - - Delays garbage collection during startup to improve performance and resets it to a more reasonable value once Emacs has started. - - Customizes `file-name-handler-alist` for improved startup time and package load time (Special thanks to the Doom Emacs developers for the `file-name-handler-alist` optimizations; This function have been inspired by their project and will contribute to improving vanilla Emacs configurations.) - - Reduces rendering workload by not rendering cursors or regions in non-focused windows. - - Disables warnings from the legacy advice API and suppresses warnings about aliased variables. - - Avoids unnecessary excessive UI updates. - - Disables font compacting to avoid high memory usage. - - Defer tool bar setup - - Unset command line options irrelevant to the current OS +The minimal-emacs.d base provides a sensible foundation for your personal configuration. It addresses common pain points in vanilla Emacs to provide a responsive and clean environment from the start, without forcing a specific workflow. -2. **Native Compilation and Byte Compilation:** - - Configures native compilation and byte compilation settings - - Suppresses compiler warnings and errors during native compilation. +### Fast Initialization and Performance -4. **UI Element Management:** - - Disables the startup screen and messages, including menu bar, tool bar, and scroll bars. - - Configures Emacs to avoid resizing frames and minimizes unnecessary UI updates. +* **Optimized File Handlers:** Defers garbage collection during startup to reduce load times, restoring it to a standard threshold once Emacs is ready. +* **Process Throughput:** Increases the chunk size for reading from processes to speed up external tool interactions. +* **Compiled File Preference:** Instructs Emacs to prioritize loading newer byte-compiled files. +* **Optimized Text Rendering:** Disables bidirectional text scanning and font compacting during startup to reduce memory usage and speed up initialization. +* **Silent Boot Sequence:** Removes the GNU Emacs startup message, unsets OS-irrelevant command line options, and defers toolbar setup. +* **Instant Scratch Buffer:** Starts the initial scratch buffer in `fundamental-mode` to reduce startup overhead. -5. **Package Management:** - - Configures package archives and priorities for MELPA, ELPA, and other repositories. +### Native Compilation and Byte Compilation -6. **Customizable Initialization Files:** - - Supports additional configuration files (`pre-init.el`, `post-init.el`, `pre-early-init.el`, and `post-early-init.el`) to allow further customization at different stages of the startup process. +* **Out-of-the-Box Optimization:** Configures default settings for native and byte compilation. +* **Quiet Compilation:** Suppresses warnings and errors during async native compilation to prevent popup interruptions. -7. **File Management:** - - Manages auto-save and backup files, including backup options and version control settings. +### Interface Defaults -8. **User Experience Enhancements:** - - Configures user interface settings such as cursor behavior, scrolling, and response to prompts. - - Disables beeping and blinking to avoid distractions. +* **Minimal UI:** Disables the startup screen, menu bar, tool bar, and scroll bars by default to maximize screen space. +* **Smart Rendering:** Stops rendering cursors and region highlights in non-focused windows. Prevents Emacs from automatically resizing frames on setting adjustments. +* **Typographic Defaults:** Renders underlines at the descent line, replaces truncation markers with an ellipsis ("..."), and disables the visible bell. +* **Focused Minibuffer:** Enables recursive minibuffers and restricts the cursor from entering read-only prompt areas. -9. **Buffer and Window Configuration:** - - Sets default fringe widths and buffer boundaries. - - Configures smooth scrolling and cursor behavior for a more seamless editing experience. +### Package and File Management -10. **Miscellaneous** - - Verifies that the Emacs configuration has loaded successfully and issues a warning if there are any issues. - - Configure and optimize settings for Eglot, recentf, savehist, auto-save, and others without enabling the modes themselves. This modifies the behavior and preferences to improve performance and usability. - - Configure Ediff to use a single frame and split windows horizontally +* **Repository Prioritization:** Configures archives and sets explicit priorities for GNU ELPA, NonGNU ELPA, and MELPA. +* **Centralized Artifacts:** Routes auto-save and backup files to dedicated subdirectories within the Emacs configuration folder. Enables versioned backups. +* **Auto-Revert:** Automatically refreshes buffers when the underlying file changes on disk. (Disabled by default) +* **Session Memory:** Saves cursor positions across sessions, maintains recent file history, and persists the minibuffer history. (Disabled by default) + +### Precision Editing and UX Enhancements + +* **Predictable Scrolling:** Configures conservative scrolling to eliminate default half-screen jumps. +* **Modern Formatting Standards:** Enforces a POSIX-compliant final newline on save, disables double-space sentence endings, and triggers smart indentation only on newlines and backspaces. +* **Sensible Tab Management:** Defaults to spaces with a tab width. Configures the tab key to indent first, then complete. +* **Fast Interactions:** Configures prompts to accept "y" or "n" instead of "yes" or "no". + +### Developer Experience + +* **Pre-Tuned Packages:** Configures optimized settings for built-in packages like Eglot, recentf, savehist, and auto-save without enabling them by default. +* **Git Integration:** Sets version control to use the `--histogram` diff algorithm and automatically follow file renames in logs. +* **Bash Scripting:** Enforces consistent indentation after line continuations in shell scripts. +* **Clean Logs:** Disables warnings from the legacy advice API and suppresses aliased variable warnings. + +### Buffer, Directory, and Window Management + +* **Modern Splits:** Favors vertical window splits over horizontal ones. +* **Ediff Optimization:** Configures Ediff to use a single frame and split windows horizontally. +* **Dired Mastery:** Enables `dired-dwim-target` for easier file operations between panes. Auto-updates Dired buffers and cleans up deleted directories silently. +* **Window Dividers:** Uses minimalistic window dividers and sets default fringe widths. + +### Security, Stability, and Customizable Initialization + +* **Safety Checks:** Verifies successful configuration load and warns of conflicts with legacy `~/.emacs` files. +* **Drop-In Customization:** Supports loading modular configuration files (`pre-early-init.el`, `post-early-init.el`, `pre-init.el`, and `post-init.el`) to hook into different stages of the startup process. +* **Strict TLS Verification:** Enforces strict SSL/TLS certificate checks and raises the minimum encryption strength for GnuTLS. +* **Encrypted Auth Sources:** Prefers GPG-encrypted authentication files (`~/.authinfo.gpg`) and directs the GPG agent to use the minibuffer for passphrase entry. ## Author and license diff --git a/init.el b/init.el index acb73f4..aa990d5 100644 --- a/init.el +++ b/init.el @@ -132,7 +132,7 @@ (setq whitespace-line-column nil) ; Use the value of `fill-column'. -;; Disable truncation of printed s-expressions in the message buffer +;; Disable ellipsis when printing s-expressions in the message buffer (setq eval-expression-print-length nil eval-expression-print-level nil) @@ -172,8 +172,10 @@ ;; Ignoring this is acceptable since it will redirect to the buffer regardless. (setq find-file-suppress-same-file-warnings t) -;; Resolve symlinks so that operations are conducted from the file's directory +;; Resolve symlinks to avoid duplicate buffers (setq find-file-visit-truename t + ;; Automatically follow a symlink to its source if that source is managed + ;; by a version control system, rather than asking for permission. vc-follow-symlinks t) ;; Prefer vertical splits over horizontal ones From d4427b6d6c311b30f26aa6e95aa2fc93d964c088 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 13 Mar 2026 14:48:29 -0400 Subject: [PATCH 103/113] Update README.md --- README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c575bfd..2445dec 100644 --- a/README.md +++ b/README.md @@ -2748,9 +2748,8 @@ The minimal-emacs.d base provides a sensible foundation for your personal config * **Optimized File Handlers:** Defers garbage collection during startup to reduce load times, restoring it to a standard threshold once Emacs is ready. * **Process Throughput:** Increases the chunk size for reading from processes to speed up external tool interactions. * **Compiled File Preference:** Instructs Emacs to prioritize loading newer byte-compiled files. -* **Optimized Text Rendering:** Disables bidirectional text scanning and font compacting during startup to reduce memory usage and speed up initialization. +* **Optimized Text Rendering:** Disables font compacting during startup to reduce memory usage and speed up initialization. * **Silent Boot Sequence:** Removes the GNU Emacs startup message, unsets OS-irrelevant command line options, and defers toolbar setup. -* **Instant Scratch Buffer:** Starts the initial scratch buffer in `fundamental-mode` to reduce startup overhead. ### Native Compilation and Byte Compilation @@ -2780,10 +2779,8 @@ The minimal-emacs.d base provides a sensible foundation for your personal config ### Developer Experience -* **Pre-Tuned Packages:** Configures optimized settings for built-in packages like Eglot, recentf, savehist, and auto-save without enabling them by default. +* **Optional Built-in Package Defaults:** Configures optimized settings for built-in packages like Eglot, recentf, savehist, and auto-save without enabling them by default. * **Git Integration:** Sets version control to use the `--histogram` diff algorithm and automatically follow file renames in logs. -* **Bash Scripting:** Enforces consistent indentation after line continuations in shell scripts. -* **Clean Logs:** Disables warnings from the legacy advice API and suppresses aliased variable warnings. ### Buffer, Directory, and Window Management From 1c6c0bd25b5422a49f517e6520f204fe270b7411 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 13 Mar 2026 14:54:57 -0400 Subject: [PATCH 104/113] Make auto-revert prompt the user --- README.md | 4 ++-- init.el | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2445dec..286ccd8 100644 --- a/README.md +++ b/README.md @@ -2767,8 +2767,8 @@ The minimal-emacs.d base provides a sensible foundation for your personal config * **Repository Prioritization:** Configures archives and sets explicit priorities for GNU ELPA, NonGNU ELPA, and MELPA. * **Centralized Artifacts:** Routes auto-save and backup files to dedicated subdirectories within the Emacs configuration folder. Enables versioned backups. -* **Auto-Revert:** Automatically refreshes buffers when the underlying file changes on disk. (Disabled by default) -* **Session Memory:** Saves cursor positions across sessions, maintains recent file history, and persists the minibuffer history. (Disabled by default) +* **Auto-Revert:** Refreshes buffers when the underlying file changes on disk. (Disabled by default.) +* **Session Memory:** Saves cursor positions across sessions, maintains recent file history, and persists the minibuffer history. (Disabled by default.) ### Precision Editing and UX Enhancements diff --git a/init.el b/init.el index aa990d5..e19aebf 100644 --- a/init.el +++ b/init.el @@ -270,9 +270,6 @@ ;;; Auto revert ;; Auto-revert in Emacs is a feature that automatically updates the contents of ;; a buffer to reflect changes made to the underlying file. -(setq revert-without-query (list ".") ; Do not prompt - auto-revert-stop-on-user-input nil - auto-revert-verbose t) ;; Revert other buffers (e.g, Dired) (setq global-auto-revert-non-file-buffers t) From e2464c646b4175024c5eb38ac57249970de51750 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 13 Mar 2026 15:15:04 -0400 Subject: [PATCH 105/113] Remove parameters that are already set to their default value --- init.el | 2 -- 1 file changed, 2 deletions(-) diff --git a/init.el b/init.el index e19aebf..a2ddfcb 100644 --- a/init.el +++ b/init.el @@ -281,7 +281,6 @@ (setq recentf-max-saved-items 300) ; default is 20 (setq recentf-max-menu-items 15) (setq recentf-auto-cleanup 'mode) -(setq recentf-exclude nil) ;;; saveplace @@ -294,7 +293,6 @@ ;; `savehist-mode' is an Emacs feature that preserves the minibuffer history ;; between sessions. (setq history-length 300) -(setq savehist-save-minibuffer-history t) ;; Default (setq savehist-additional-variables '(register-alist ; macros mark-ring global-mark-ring ; marks From 2fdc134822cd1c24934709331b943bacb2d4f637 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 13 Mar 2026 15:18:44 -0400 Subject: [PATCH 106/113] Remove more parameters that are already set to their default value --- init.el | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/init.el b/init.el index a2ddfcb..1dcf200 100644 --- a/init.el +++ b/init.el @@ -161,7 +161,6 @@ ;;; Tramp (setq tramp-verbose 1) -(setq tramp-completion-reread-directory-timeout 50) ;;; Files @@ -300,10 +299,6 @@ ;;; Frames and windows -;; However, do not resize windows pixelwise, as this can cause crashes in some -;; cases when resizing too many windows at once or rapidly. -(setq window-resize-pixelwise nil) - (setq resize-mini-windows 'grow-only) ;; The native border "uses" a pixel of the fringe on the rightmost @@ -333,20 +328,10 @@ ;; 2. Resolving the issue of random half-screen jumps during scrolling. (setq auto-window-vscroll nil) -;; Number of lines of margin at the top and bottom of a window. -(setq scroll-margin 0) - -;; Number of lines of continuity when scrolling by screenfuls. -(setq next-screen-context-lines 0) - ;; Horizontal scrolling (setq hscroll-margin 2 hscroll-step 1) -;;; Mouse - -(setq mouse-yank-at-point nil) - ;; Emacs 29 (when (memq 'context-menu minimal-emacs-ui-features) (when (and (display-graphic-p) (fboundp 'context-menu-mode)) @@ -362,9 +347,6 @@ ;; Don't blink the paren matching the one at point, it's too distracting. (setq blink-matching-paren nil) -;; Do not extend the cursor to fit wide characters -(setq x-stretch-cursor nil) - ;; Reduce rendering/line scan work by not rendering cursors or regions in ;; non-focused windows. (setq highlight-nonselected-windows nil) @@ -378,10 +360,6 @@ ;; deletion, disrupting the flow of editing. (setq delete-pair-blink-delay 0.03) -;; Disable visual indicators in the fringe for buffer boundaries and empty lines -(setq-default indicate-buffer-boundaries nil) -(setq-default indicate-empty-lines nil) - ;; Continue wrapped lines at whitespace rather than breaking in the ;; middle of a word. (setq-default word-wrap t) From 314b8a18504b4b68d0110ea26abd2d0fc02e3cc7 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 13 Mar 2026 21:40:30 -0400 Subject: [PATCH 107/113] Enhance support for non interactive mode --- README.md | 6 ++++-- early-init.el | 10 +++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 286ccd8..ac07669 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,8 @@ Startup speed depends on hardware and disk speed. For consistent comparisons, te - [jeenajeena on Reddit](https://www.reddit.com/r/emacs/comments/1p9y8h4/comment/nrfk13i/): "Thank you. Plenty of inspiring settings. Worth to be read line by line." - [uutangohotel on Reddit](https://www.reddit.com/r/emacs/comments/1p9y8h4/comment/nrg5kja/): "I get a lot out of minimal-emacs.d — thank you! I use stow to manage my dotfiles in a git repo. I created a submodule in one dir for minimal-emacs.d and another for my “overrides”, e.g. post-init.el. Easy and works great." - [sunng on Reddit](https://www.reddit.com/r/emacs/comments/1p9y8h4/comment/ns1nehi/): "Nice work! I just created a nix flake to using it on my dev servers" +- [zackattackz287 on Reddit](https://www.reddit.com/r/emacs/comments/1rsmaut/comment/oa8okca/): "Congrats and thank you (and the community around minimal.d) for your work! I've been using it for quite a while now and I've not ever had any breakages when merging changes from main..." +- [utility on Reddit](https://www.reddit.com/r/emacs/comments/1rsmaut/comment/oa8wrap/): "Excellent. I use this and I'm very happy with it!" Please share your configuration. It could serve as inspiration for other users. @@ -365,11 +367,11 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already :hook (after-init . global-auto-revert-mode) :init + ;; (setq auto-revert-verbose t) (setq auto-revert-interval 3) (setq auto-revert-remote-files nil) (setq auto-revert-use-notify t) - (setq auto-revert-avoid-polling nil) - (setq auto-revert-verbose t)) + (setq auto-revert-avoid-polling nil)) ;; Recentf is an Emacs package that maintains a list of recently ;; accessed files, making it easier to reopen files you have worked on diff --git a/early-init.el b/early-init.el index 0dcb7d3..2e0fdac 100644 --- a/early-init.el +++ b/early-init.el @@ -124,8 +124,10 @@ Note that this should end with a directory separator.") (error "Emacs ignored loading 'init.el'. Please ensure that files such as ~/.emacs or ~/.emacs.el do not exist, as they may be preventing Emacs from loading the 'init.el' file")) (t - (error "Configuration error. Debug by starting Emacs with: emacs --debug-init"))))) -(add-hook 'emacs-startup-hook #'minimal-emacs--check-success 102) + (error "Configuration error. Debug by starting Emacs with: --debug-init"))))) + +(unless noninteractive + (add-hook 'emacs-startup-hook #'minimal-emacs--check-success 102)) (defvar minimal-emacs-load-compiled-init-files nil "If non-nil, attempt to load byte-compiled .elc for init files. @@ -174,7 +176,9 @@ pre-early-init.el, and post-early-init.el.") (defun minimal-emacs--restore-gc () "Restore garbage collection settings." - (if (bound-and-true-p minimal-emacs-gc-cons-threshold-restore-delay) + (if (and (bound-and-true-p minimal-emacs-gc-cons-threshold-restore-delay) + ;; In noninteractive mode, the event loop does not run + (not noninteractive)) ;; Defer garbage collection during initialization to avoid 2 collections. (run-with-timer minimal-emacs-gc-cons-threshold-restore-delay nil #'minimal-emacs--restore-gc-values) From df22269c99eb507c226f2f70c3ded350f31a5432 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 14 Mar 2026 15:44:16 -0400 Subject: [PATCH 108/113] Update README.md --- README.md | 58 ++++++++++++++++--------------------------------------- 1 file changed, 17 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index ac07669..ea5a1ec 100644 --- a/README.md +++ b/README.md @@ -292,7 +292,6 @@ Native compilation enhances Emacs performance by converting Elisp code into nati ;; Ensure adding the following compile-angel code at the very beginning ;; of your `~/.emacs.d/post-init.el` file, before all other packages. (use-package compile-angel - :ensure t :demand t :config ;; The following disables compilation of packages during installation; @@ -336,7 +335,6 @@ To fix this, add **exec-path-from-shell** to `~/.emacs.d/post-init.el`: (use-package exec-path-from-shell :if (and (or (display-graphic-p) (daemonp)) (eq system-type 'darwin)) ; macOS only - :ensure t :demand t :functions exec-path-from-shell-initialize :config @@ -478,7 +476,6 @@ To configure `corfu` and `cape`, add the following to `~/.emacs.d/post-init.el`: ;; current candidates, positioned either below or above the point. Candidates ;; can be selected by navigating up or down. (use-package corfu - :ensure t :commands (corfu-mode global-corfu-mode) :hook ((prog-mode . corfu-mode) @@ -500,7 +497,6 @@ To configure `corfu` and `cape`, add the following to `~/.emacs.d/post-init.el`: ;; in-buffer completion. It integrates with Corfu or the default completion UI, ;; by providing additional backends through completion-at-point-functions. (use-package cape - :ensure t :commands (cape-dabbrev cape-file cape-elisp-block) :bind ("C-c p" . cape-prefix-map) :init @@ -529,7 +525,6 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E ;; navigate and select from completion candidates (e.g., when `M-x` is pressed). (use-package vertico ;; (Note: It is recommended to also enable the savehist package.) - :ensure t :config (vertico-mode)) @@ -537,7 +532,6 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E ;; to input multiple patterns separated by spaces, which Orderless then ;; matches in any order against the candidates. (use-package orderless - :ensure t :custom (completion-styles '(orderless basic)) (completion-category-defaults nil) @@ -547,7 +541,6 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E ;; In addition to that, Marginalia also enhances Vertico by adding rich ;; annotations to the completion candidates displayed in Vertico's interface. (use-package marginalia - :ensure t :commands (marginalia-mode marginalia-cycle) :hook (after-init . marginalia-mode)) @@ -559,7 +552,6 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E ;; Embark is an Emacs package that acts like a context menu, allowing ;; users to perform context-sensitive actions on selected items ;; directly from the completion interface. - :ensure t :commands (embark-act embark-dwim embark-export @@ -582,14 +574,12 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E (window-parameters (mode-line-format . none))))) (use-package embark-consult - :ensure t :hook (embark-collect-mode . consult-preview-at-point-mode)) ;; Consult offers a suite of commands for efficient searching, previewing, and ;; interacting with buffers, file contents, and more, improving various tasks. (use-package consult - :ensure t :bind (;; C-c bindings in `mode-specific-map' ("C-c M-x" . consult-mode-command) ("C-c h" . consult-history) @@ -695,7 +685,6 @@ To install and configure these packages, add the following to `~/.emacs.d/post-i ;; The undo-fu package is a lightweight wrapper around Emacs' built-in undo ;; system, providing more convenient undo/redo functionality. (use-package undo-fu - :ensure t :commands (undo-fu-only-undo undo-fu-only-redo undo-fu-only-redo-all @@ -708,7 +697,6 @@ To install and configure these packages, add the following to `~/.emacs.d/post-i ;; The undo-fu-session package complements undo-fu by enabling the saving ;; and restoration of undo history across Emacs sessions, even after restarting. (use-package undo-fu-session - :ensure t :commands undo-fu-session-global-mode :hook (after-init . undo-fu-session-global-mode)) ``` @@ -770,7 +758,6 @@ Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency ;; Vim emulation (use-package evil - :ensure t :commands (evil-mode evil-define-key) :hook (after-init . evil-mode) @@ -811,7 +798,6 @@ Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency (use-package evil-collection :after evil - :ensure t :init ;; It has to be defined before evil-colllection (setq evil-collection-setup-minibuffer t) @@ -832,7 +818,6 @@ You can also install the [vim-tab-bar](https://github.com/jamescherti/vim-tab-ba ``` emacs-lisp ;; Give Emacs tab-bar a style similar to Vim's (use-package vim-tab-bar - :ensure t :commands vim-tab-bar-mode :hook (after-init . vim-tab-bar-mode)) ``` @@ -850,7 +835,6 @@ The `evil-surround` package simplifies handling surrounding characters, such as ;; using S" or gS". (use-package evil-surround :after evil - :ensure t :commands global-evil-surround-mode :custom (evil-surround-pairs-alist @@ -896,7 +880,6 @@ To configure **easysession**, add the following to `~/.emacs.d/post-init.el`: ;; manage Emacs editing sessions and utilizes built-in Emacs functions to ;; persist and restore frames. (use-package easysession - :ensure t :commands (easysession-switch-to easysession-save-as easysession-save-mode @@ -961,7 +944,6 @@ This configuration sets up `markdown-mode` with deferred loading to improve star ```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 @@ -1077,7 +1059,6 @@ For folding based on indentation levels, the **[outline-indent](https://github.c ;; - Move backward/forward to the indentation level of the current line ;; - and other features. (use-package outline-indent - :ensure t :commands outline-indent-minor-mode :custom @@ -1146,7 +1127,6 @@ To configure **apheleia**, add the following to `~/.emacs.d/post-init.el`: ;; Apheleia is an Emacs package designed to run code formatters (e.g., Shfmt, ;; Black and Prettier) asynchronously without disrupting the cursor position. (use-package apheleia - :ensure t :commands (apheleia-mode apheleia-global-mode) :hook ((prog-mode . apheleia-mode))) @@ -1201,7 +1181,6 @@ The [yasnippet-snippets](https://github.com/AndreaCrotti/yasnippet-snippets) pac ```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 @@ -1209,7 +1188,6 @@ The [yasnippet-snippets](https://github.com/AndreaCrotti/yasnippet-snippets) pac ;; 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) @@ -1309,7 +1287,6 @@ To enable **stripspace** and automatically delete trailing whitespace, add the f ;; that automatically removes trailing whitespace and blank lines at the end of ;; the buffer when saving. (use-package stripspace - :ensure t :commands stripspace-local-mode ;; Enable for prog-mode-hook, text-mode-hook, conf-mode-hook @@ -1364,7 +1341,6 @@ To configure **org-mode**, add the following to `~/.emacs.d/post-init.el`: ;; scheduling, deadlines, time tracking, and exporting to multiple formats ;; including HTML, LaTeX, PDF, and Markdown. (use-package org - :ensure t :commands (org-mode org-version) :mode ("\\.org\\'" . org-mode) @@ -1434,7 +1410,6 @@ To configure **auto-package-update**, add the following to `~/.emacs.d/post-init ```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 @@ -1479,7 +1454,6 @@ To configure **buffer-terminator**, add the following to `~/.emacs.d/post-init.e ```emacs-lisp (use-package buffer-terminator - :ensure t :custom ;; Enable/Disable verbose mode to log buffer cleanup events (buffer-terminator-verbose nil) @@ -1511,7 +1485,6 @@ To configure **treemacs**, add the following to `~/.emacs.d/post-init.el`: ;; in the left window, providing a persistent view of files, projects, and ;; other elements. (use-package treemacs - :ensure t :commands (treemacs treemacs-select-window treemacs-delete-other-windows @@ -1611,15 +1584,12 @@ To configure **treemacs**, add the following to `~/.emacs.d/post-init.el`: ;; (use-package treemacs-evil ;; :after (treemacs evil) -;; :ensure t) ;; ;; (use-package treemacs-icons-dired ;; :hook (dired-mode . treemacs-icons-dired-enable-once) -;; :ensure t) ;; ;; (use-package treemacs-tab-bar ; treemacs-tab-bar if you use tab-bar-mode ;; :after (treemacs) -;; :ensure t ;; :config (treemacs-set-scope-type 'Tabs)) ;; ;; (treemacs-start-on-boot) @@ -1634,7 +1604,6 @@ To configure **helpful**, add the following to `~/.emacs.d/post-init.el`: ;; Helpful is an alternative to the built-in Emacs help that provides much more ;; contextual information. (use-package helpful - :ensure t :commands (helpful-callable helpful-variable helpful-key @@ -1660,7 +1629,6 @@ It operates by generating a dynamic, temporary mapping: upon invocation, such as 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) @@ -1682,7 +1650,6 @@ The functions above also ensures that any modified buffers are saved prior to ex To configure **bufferfile**, add the following to `~/.emacs.d/post-init.el`: ```elisp (use-package bufferfile - :ensure t :commands (bufferfile-copy bufferfile-rename bufferfile-delete) @@ -1710,14 +1677,12 @@ To enhance the Elisp development experience, add the following to `~/.emacs.d/po ```emacs-lisp ;; Enables automatic indentation of code while typing (use-package aggressive-indent - :ensure t :commands aggressive-indent-mode :hook (emacs-lisp-mode . aggressive-indent-mode)) ;; Highlights function and variable definitions in Emacs Lisp mode (use-package highlight-defined - :ensure t :commands highlight-defined-mode :hook (emacs-lisp-mode . highlight-defined-mode)) @@ -1727,7 +1692,6 @@ Other optional packages that may be useful include: ```emacs-lisp ;; Prevent parenthesis imbalance (use-package paredit - :ensure t :commands paredit-mode :hook (emacs-lisp-mode . paredit-mode) @@ -1737,14 +1701,12 @@ Other optional packages that may be useful include: ;; For paredit+Evil mode users: enhances paredit with Evil mode compatibility ;; -------------------------------------------------------------------------- ;; (use-package enhanced-evil-paredit -;; :ensure t ;; :commands enhanced-evil-paredit-mode ;; :hook ;; (paredit-mode . enhanced-evil-paredit-mode)) ;; Displays visible indicators for page breaks (use-package page-break-lines - :ensure t :commands (page-break-lines-mode global-page-break-lines-mode) :hook @@ -1753,7 +1715,6 @@ Other optional packages that may be useful include: ;; Provides functions to find references to functions, macros, variables, ;; special forms, and symbols in Emacs Lisp (use-package elisp-refs - :ensure t :commands (elisp-refs-function elisp-refs-macro elisp-refs-variable @@ -1777,7 +1738,6 @@ To configure **inhibit-mouse**, add the following to `~/.emacs.d/post-init.el`: ;; - Reinforce a keyboard-centric workflow by discouraging reliance on the mouse ;; for navigation. (use-package inhibit-mouse - :ensure t :config (if (daemonp) (add-hook 'server-after-make-frame-hook #'inhibit-mouse-mode) @@ -1805,7 +1765,6 @@ To enable *quick-sdcv*, add the following to your `~/.emacs.d/post-init.el`: ```emacs-lisp (use-package quick-sdcv - :ensure t :custom (quick-sdcv-unique-buffers t) (quick-sdcv-dictionary-prefix-symbol "►") @@ -2265,6 +2224,8 @@ The `straight.el` package is a declarative package manager for Emacs that aims t (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) + +(setq straight-use-package-by-default t) ``` ### Configuring Elpaca (package manager) @@ -2326,6 +2287,21 @@ And [add the Elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read ;; Optional: Install use-package support ;; (elpaca elpaca-use-package ;; (elpaca-use-package-mode)) + +(elpaca + elpaca-use-package + ;; Enable use-package :ensure support for Elpaca. + (elpaca-use-package-mode)) + +;; TODO windows +;; Uncomment for systems which cannot create symlinks: +;; (elpaca-no-symlink-mode) + +;; Install use-package support +(elpaca + elpaca-use-package + ;; Enable use-package :ensure support for Elpaca. + (elpaca-use-package-mode)) ``` ## Frequently asked questions From 5cabe62116086fd8f7e2b413604a0d28a12ad5d6 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 14 Mar 2026 15:45:34 -0400 Subject: [PATCH 109/113] Update README.md --- README.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/README.md b/README.md index ea5a1ec..a35291d 100644 --- a/README.md +++ b/README.md @@ -2284,16 +2284,6 @@ And [add the Elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read (add-hook 'after-init-hook #'elpaca-process-queues) (elpaca `(,@elpaca-order)) -;; Optional: Install use-package support -;; (elpaca elpaca-use-package -;; (elpaca-use-package-mode)) - -(elpaca - elpaca-use-package - ;; Enable use-package :ensure support for Elpaca. - (elpaca-use-package-mode)) - -;; TODO windows ;; Uncomment for systems which cannot create symlinks: ;; (elpaca-no-symlink-mode) From 00908de3b96f9deca1bc7fe3b4a48e0d9b48bef6 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 14 Mar 2026 15:47:32 -0400 Subject: [PATCH 110/113] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a35291d..bfca4ea 100644 --- a/README.md +++ b/README.md @@ -2284,8 +2284,10 @@ And [add the Elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read (add-hook 'after-init-hook #'elpaca-process-queues) (elpaca `(,@elpaca-order)) -;; Uncomment for systems which cannot create symlinks: -;; (elpaca-no-symlink-mode) +;; Enable 'elpaca-no-symlink-mode' on Windows, as symlink creation +;; often fails without Administrator privileges or Developer Mode. +(when (eq system-type 'windows-nt) + (elpaca-no-symlink-mode 1)) ;; Install use-package support (elpaca From ce8a2e3f00fbc60f58c18de173ec3fad5b4ad15c Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 14 Mar 2026 15:47:55 -0400 Subject: [PATCH 111/113] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index bfca4ea..8aa0c4a 100644 --- a/README.md +++ b/README.md @@ -2290,8 +2290,7 @@ And [add the Elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read (elpaca-no-symlink-mode 1)) ;; Install use-package support -(elpaca - elpaca-use-package +(elpaca elpaca-use-package ;; Enable use-package :ensure support for Elpaca. (elpaca-use-package-mode)) ``` From f08b02eadca48ebb87a1a76b720f5c38ade53180 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 16 Mar 2026 18:19:59 -0400 Subject: [PATCH 112/113] Release: 1.4.1 --- 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 2e0fdac..e47c225 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.4.0 +;; Version: 1.4.1 ;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Commentary: diff --git a/init.el b/init.el index 1dcf200..fc25abe 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.4.0 +;; Version: 1.4.1 ;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Commentary: From 28d44b4fe7129a45c2327eac36578ee0bf94dd46 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 17 Mar 2026 14:28:03 -0400 Subject: [PATCH 113/113] Fixes #88: After loading, modeline is invisible in the *Message* buffer --- early-init.el | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/early-init.el b/early-init.el index e47c225..c0c97e9 100644 --- a/early-init.el +++ b/early-init.el @@ -359,6 +359,9 @@ this stage of initialization." ;;; Performance: Disable mode-line during startup +(defvar-local minimal-emacs--hidden-mode-line nil + "Store the buffer-local value of `mode-line-format' during startup.") + (when (and minimal-emacs-disable-mode-line-during-startup (not noninteractive) (not minimal-emacs-debug)) @@ -367,7 +370,9 @@ this stage of initialization." (setq-default mode-line-format nil) (dolist (buf (buffer-list)) (with-current-buffer buf - (setq mode-line-format nil)))) + (when (local-variable-p 'mode-line-format) + (setq minimal-emacs--hidden-mode-line mode-line-format) + (setq mode-line-format nil))))) ;;; Restore values @@ -386,7 +391,12 @@ this stage of initialization." (when minimal-emacs-disable-mode-line-during-startup (unless (default-toplevel-value 'mode-line-format) (setq-default mode-line-format (get 'mode-line-format - 'initial-value)))))) + 'initial-value))) + (dolist (buf (buffer-list)) + (with-current-buffer buf + (when (local-variable-p 'minimal-emacs--hidden-mode-line) + (setq mode-line-format minimal-emacs--hidden-mode-line) + (kill-local-variable 'minimal-emacs--hidden-mode-line))))))) (advice-add 'startup--load-user-init-file :around #'minimal-emacs--startup-load-user-init-file)