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ZD?Ul80}Ue=W&d_&t~tQte2cgj@)mNjuNqUol7p##Fk;}uCDkcX9H_M6Bs&Zz0>5h zI4(FS!#^Z{_AJJDmzTJZG%fJ%a?gyxWj~&39!n|wwY&9t>QA9BVy~xkuxf6*yogay zr{-lM-r|=Y3S^uyJVOr)Z93aewm0ymPukbe*-D`SiaMi(@krJnw#M*f0)qS7EyOoO zI R>ZNF*to`+vq;TSBYcsI@oPVSgacz?TQ8#DF2 ;_@EUPl z>QjsJ{edI>WS`@F*T<)bEb0%1wT@d(%H8J)
B?|bxZDTlKsSgxmSa9 zf9>dx;_sJj{tqiZ(1r6IILi*2-*badDnwDN#-x&~bbq(%!`w*Lr)1wl8{086Rscfj y Date: Wed, 7 May 2025 18:04:19 -0400 Subject: [PATCH 20/96] Update README.md --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 91d6228..be528a5 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's - [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 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) @@ -1145,6 +1146,32 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read ## Frequently asked questions +### Customizing Scroll Recentering + +By default, minimal-emacs.d sets `scroll-conservatively` to `101`: + +```emacs-lisp +(setq scroll-conservatively 101) ; Default minimal-emacs.d value +``` + +A value of `101` minimizes screen movement and maintains point visibility with minimal adjustment, which many users find optimal for rapid navigation. + +You can override this in your `post-init.el` file. Setting it to `0` forces Emacs to recenter the point aggressively, typically positioning it in the middle of the window: + +```emacs-lisp +(setq scroll-conservatively 0) ; NOT RECOMMENDED. SET IT TO 101 INSTEAD. +``` + +Although this offers more surrounding context, it results in frequent and pronounced screen movement, which can disrupt navigation. A value of `0` is generally discouraged unless this behavior is explicitly desired. + +Most users prefer `101`. Some select `10` as a compromise: + +```emacs-lisp +(setq scroll-conservatively 10) ; Note: You might prefer 101 over 10. +``` + +A value of `10` permits occasional recentering for additional context but introduces more movement than `101`. + ### How to display Emacs startup duration? To measure and display the time taken for Emacs to start, you can use the following Emacs Lisp function. This function will report both the startup duration and the number of garbage collections that occurred during initialization. From e66af5dc271711116eac1cae69fc4b8a0bd933bb Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Sun, 11 May 2025 07:28:15 +0200 Subject: [PATCH 21/96] Add missing dot in ~/emacs.d/var path Introduced in the "Reducing clutter in `~/.emacs.d`" section, the documented path is inconsistent with the actual effectual value. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index be528a5..673c72c 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's - [Preventing Emacs from saving custom.el](#preventing-emacs-from-saving-customel) - [Which other customizations can be interesting to add?](#which-other-customizations-can-be-interesting-to-add) - [Customizations: pre-early-init.el](#customizations-pre-early-initel) - - [Reducing clutter in `~/.emacs.d` by redirecting files to `~/emacs.d/var/`](#reducing-clutter-in-emacsd-by-redirecting-files-to-emacsdvar) + - [Reducing clutter in `~/.emacs.d` by redirecting files to `~/.emacs.d/var/`](#reducing-clutter-in-emacsd-by-redirecting-files-to-emacsdvar) - [Configuring straight.el?](#configuring-straightel) - [Configuring elpaca (package manager)](#configuring-elpaca-package-manager) - [Frequently asked questions](#frequently-asked-questions) @@ -1045,7 +1045,7 @@ It is also recommended to read the following articles: ## Customizations: pre-early-init.el -### Reducing clutter in `~/.emacs.d` by redirecting files to `~/emacs.d/var/` +### Reducing clutter in `~/.emacs.d` by redirecting files to `~/.emacs.d/var/` Emacs, by default, stores various configuration files, caches, backups, and other data in the `~/.emacs.d` directory. Over time, this directory can become cluttered with numerous files, making it difficult to manage and maintain. @@ -1053,7 +1053,7 @@ A common solution to this issue is installing the no-littering package; however, An alternative lightweight approach is to simply change the default `~/.emacs.d` directory to `~/.emacs.d/var/`, which will contain all the files that Emacs typically stores in the base directory. This can be accomplished by adding the following code to `~/.emacs.d/pre-early-init.el`: ``` emacs-lisp -;; Reducing clutter in ~/.emacs.d by redirecting files to ~/emacs.d/var/ +;; Reducing clutter in ~/.emacs.d by redirecting files to ~/.emacs.d/var/ ;; IMPORTANT: This part should be in the pre-early-init.el file (setq minimal-emacs-var-dir (expand-file-name "var/" minimal-emacs-user-directory)) (setq package-user-dir (expand-file-name "elpa" minimal-emacs-var-dir)) From c25ef5c081e811ddfbd394e8a71a3e7b22a8ad71 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 11 May 2025 16:03:17 -0400 Subject: [PATCH 22/96] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 673c72c..d73b5f7 100644 --- a/README.md +++ b/README.md @@ -1345,6 +1345,7 @@ A drawback of using the early-init phase instead of init is that if a package fa - [rrajath](https://www.reddit.com/r/emacs/comments/1ihn2tv/comment/mb0ja8k/) has been using the minimal-emacs.d config for the past several months and loves it. His previous setup used to take around 4 seconds to load, but with minimal-emacs.d, it now loads in just 1 second. - [LionyxML](https://www.reddit.com/r/emacs/comments/1ihn2tv/comment/mb35t9y/) considers that *minimal-emacs.d* contains one of the best README files he has ever read. The author of *minimal-emacs.d* found his comment encouraging. Reading this README.md is highly recommended for anyone looking to start customizing their *minimal-emacs.d* configuration. - [cyneox](https://www.reddit.com/r/emacs/comments/1ihn2tv/comment/mdnzgqx/): "Still using it and loving it! Thanks for the regular updates." +- [panchoh](https://github.com/jamescherti/minimal-emacs.d/pull/62#issuecomment-2869865979): "...thank you, @jamescherti! Keep up the fantastic work you are doing!" ### Minimal-emacs.d configurations from users From 146fc32bb0cb11c250f67a106b460ab99dbe9259 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 11 May 2025 16:45:03 -0400 Subject: [PATCH 23/96] Update README.md --- init.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/init.el b/init.el index 2f495a5..e78aa0c 100644 --- a/init.el +++ b/init.el @@ -291,8 +291,7 @@ ;; Don't blink the paren matching the one at point, it's too distracting. (setq blink-matching-paren nil) -;; Don't stretch the cursor to fit wide characters, it is disorienting, -;; especially for tabs. +;; 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 From fc90ee759ae8799d42296fcde25de7b7ed004fde Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 13 May 2025 11:21:03 -0400 Subject: [PATCH 24/96] Fixes #63: Add trailing whitespace cleanup --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/README.md b/README.md index d73b5f7..83f2f5f 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's - [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) - [Customizations: Packages (post-init.el)](#customizations-packages-post-initel) - [Optimization: Native Compilation](#optimization-native-compilation) + - [Automatic removal of trailing whitespace on save](#automatic-removal-of-trailing-whitespace-on-save) - [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) @@ -226,6 +227,38 @@ Native compilation enhances Emacs performance by converting Elisp code into nati (compile-angel-on-load-mode)) ``` +### 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** 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 +(use-package stripspace + :ensure t + + ;; 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)) +``` + ### How to activate 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 ea52fedbe11f4c4c288563dc0e3d83be608e8f8d Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 13 May 2025 11:28:45 -0400 Subject: [PATCH 25/96] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 83f2f5f..11f8fc8 100644 --- a/README.md +++ b/README.md @@ -1468,3 +1468,4 @@ Other Emacs packages by the same author: - [inhibit-mouse.el](https://github.com/jamescherti/inhibit-mouse.el): A package that disables mouse input in Emacs, offering a simpler and faster alternative to the disable-mouse package. - [quick-sdcv.el](https://github.com/jamescherti/quick-sdcv.el): This package enables Emacs to function as an offline dictionary by using the sdcv command-line tool directly within Emacs. - [enhanced-evil-paredit.el](https://github.com/jamescherti/enhanced-evil-paredit.el): An Emacs package that prevents parenthesis imbalance when using *evil-mode* with *paredit*. It intercepts *evil-mode* commands such as delete, change, and paste, blocking their execution if they would break the parenthetical structure. +- [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. From ace381cab6ec1d307f23ad5e9c574199a3a72139 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 13 May 2025 11:38:26 -0400 Subject: [PATCH 26/96] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 11f8fc8..20fcbbc 100644 --- a/README.md +++ b/README.md @@ -1469,3 +1469,4 @@ Other Emacs packages by the same author: - [quick-sdcv.el](https://github.com/jamescherti/quick-sdcv.el): This package enables Emacs to function as an offline dictionary by using the sdcv command-line tool directly within Emacs. - [enhanced-evil-paredit.el](https://github.com/jamescherti/enhanced-evil-paredit.el): An Emacs package that prevents parenthesis imbalance when using *evil-mode* with *paredit*. It intercepts *evil-mode* commands such as delete, change, and paste, blocking their execution if they would break the parenthetical structure. - [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. From 101a5ed0bb8b67246b310c9d3d0104925ba2a39a Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 13 May 2025 11:41:26 -0400 Subject: [PATCH 27/96] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 20fcbbc..81878ee 100644 --- a/README.md +++ b/README.md @@ -1470,3 +1470,4 @@ Other Emacs packages by the same author: - [enhanced-evil-paredit.el](https://github.com/jamescherti/enhanced-evil-paredit.el): An Emacs package that prevents parenthesis imbalance when using *evil-mode* with *paredit*. It intercepts *evil-mode* commands such as delete, change, and paste, blocking their execution if they would break the parenthetical structure. - [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. From 732c8adf44213e335083859cf0d55c149f4e513d Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 13 May 2025 12:05:06 -0400 Subject: [PATCH 28/96] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 81878ee..c64da72 100644 --- a/README.md +++ b/README.md @@ -237,6 +237,8 @@ To enable **stripspace** and automatically delete trailing whitespace, add the f ```elisp (use-package stripspace :ensure t + :defer t + :commands stripspace-local-mode ;; Enable for prog-mode-hook, text-mode-hook, conf-mode-hook :hook ((prog-mode . stripspace-local-mode) From 5f96877e6bfac0c916c4e760ac7128fd786db62b Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 14 May 2025 08:59:52 -0400 Subject: [PATCH 29/96] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index c64da72..50249d0 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,12 @@ 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. +For those new to Emacs wondering what `init.el` or `early-init.el` are: + +- The `early-init.el` file is an initialization file that is loaded very early in the startup process, before the Emacs graphical interface is initialized. It was introduced in Emacs 27 to allow users to configure aspects of Emacs that affect startup performance and GUI elements that need to be set before the packages load. + +- The `init.el` file is the main user configuration file that Emacs loads after initializing the package system and basic runtime environment. It contains user customizations, such as setting variables, loading packages, configuring modes, and defining keybindings. + 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? You have found it. From afadb21c21faabad2e33780bc8a68cf33b7c4a26 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 14 May 2025 09:06:20 -0400 Subject: [PATCH 30/96] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 50249d0..9bf479f 100644 --- a/README.md +++ b/README.md @@ -7,14 +7,14 @@ 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. -For those new to Emacs wondering what `init.el` or `early-init.el` are: - -- The `early-init.el` file is an initialization file that is loaded very early in the startup process, before the Emacs graphical interface is initialized. It was introduced in Emacs 27 to allow users to configure aspects of Emacs that affect startup performance and GUI elements that need to be set before the packages load. - -- The `init.el` file is the main user configuration file that Emacs loads after initializing the package system and basic runtime environment. It contains user customizations, such as setting variables, loading packages, configuring modes, and defining keybindings. - 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`: Emacs loads this file early in the startup process, before the graphical interface is initialized. Introduced in Emacs 27, it allows configuration of settings that affect startup performance and GUI elements that must be set before any packages are loaded. + +- `init.el`: This file contains user customizations, such as setting variables, loading packages, configuring modes, and defining keybindings. + ## Looking for the ideal starter kit to customize Emacs? You have found it. The *minimal-emacs.d* project is: From 4f75aa2d96ba70b45f2dafc3b83715dad989559c Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 14 May 2025 09:07:16 -0400 Subject: [PATCH 31/96] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9bf479f..7333758 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of * The minimal-emacs.d project includes two initialization files: -- `early-init.el`: Emacs loads this file early in the startup process, before the graphical interface is initialized. Introduced in Emacs 27, it allows configuration of settings that affect startup performance and GUI elements that must be set before any packages are loaded. +- `early-init.el`: A file that is loaded early in the startup process, before the Emacs graphical interface is initialized. Introduced in Emacs 27, it allows configuration of settings that affect startup performance and GUI elements that must be set before any packages are loaded. - `init.el`: This file contains user customizations, such as setting variables, loading packages, configuring modes, and defining keybindings. From e89822d0a0079f0ef850270ac4018ee12db642ca Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 14 May 2025 09:17:31 -0400 Subject: [PATCH 32/96] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7333758..cab6b2c 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,9 @@ Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of * The minimal-emacs.d project includes two initialization files: -- `early-init.el`: A file that is loaded early in the startup process, before the Emacs graphical interface is initialized. Introduced in Emacs 27, it allows configuration of settings that affect startup performance and GUI elements that must be set before any packages are loaded. +- `early-init.el`: An init file that is loaded by Emacs early in the startup process, before the Emacs graphical interface is initialized. Introduced in Emacs 27, it allows configuration of settings that affect startup performance and GUI elements that must be set before any packages are loaded. -- `init.el`: This file contains user customizations, such as setting variables, loading packages, configuring modes, and defining keybindings. +- `init.el`: An init file that is loaded by Emacs after the graphical interface is initialized. It contains user customizations, such as setting variables, loading packages, configuring modes, and defining keybindings. ## Looking for the ideal starter kit to customize Emacs? You have found it. From 45d85ad08d060ce464ce19cea0e5f8acadfa1e64 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 14 May 2025 09:18:15 -0400 Subject: [PATCH 33/96] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cab6b2c..7bdae22 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,11 @@ The **minimal-emacs.d** project is a lightweight and optimized Emacs base (`init 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: +The *minimal-emacs.d* project includes two initialization files: -- `early-init.el`: An init file that is loaded by Emacs early in the startup process, before the Emacs graphical interface is initialized. Introduced in Emacs 27, it allows configuration of settings that affect startup performance and GUI elements that must be set before any packages are loaded. +- `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`: An init file that is loaded by Emacs after the graphical interface is initialized. It contains user customizations, such as setting variables, loading packages, configuring modes, and defining keybindings. +- `init.el`: Loaded after the graphical interface is initialized. This file contains user customizations, including variable settings, package loading, mode configurations, and keybindings. ## Looking for the ideal starter kit to customize Emacs? You have found it. From ebc74a8aaed6ea63b629012e1961796a97490677 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 14 May 2025 09:21:35 -0400 Subject: [PATCH 34/96] Update README.md --- README.md | 72 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 7bdae22..54b76d9 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,6 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's - [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) - [Customizations: Packages (post-init.el)](#customizations-packages-post-initel) - [Optimization: Native Compilation](#optimization-native-compilation) - - [Automatic removal of trailing whitespace on save](#automatic-removal-of-trailing-whitespace-on-save) - [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) @@ -66,6 +65,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's - [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) @@ -221,6 +221,8 @@ Native compilation enhances Emacs performance by converting Elisp code into nati ;; implications and thoroughly test your code. For example, if you're using ;; `use-package', you'll need to explicitly add `(require 'use-package)` at ;; the top of your init file. + (push "/init.el" compile-angel-excluded-files) + (push "/early-init.el" compile-angel-excluded-files) (push "/pre-init.el" compile-angel-excluded-files) (push "/post-init.el" compile-angel-excluded-files) (push "/pre-early-init.el" compile-angel-excluded-files) @@ -233,40 +235,6 @@ Native compilation enhances Emacs performance by converting Elisp code into nati (compile-angel-on-load-mode)) ``` -### 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** 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 -(use-package stripspace - :ensure t - :defer 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)) -``` - ### How to activate 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`: @@ -600,6 +568,40 @@ 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 +(use-package stripspace + :ensure t + :defer 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 package is a lightweight wrapper around Emacs' built-in undo system, providing more convenient undo/redo functionality while preserving access to the full undo history. The undo-fu-session package complements undo-fu by enabling the saving and restoration of undo history across Emacs sessions, even after restarting. From 7b99dbb581f9c2fd989ea984eea4ddda84c1952a Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 23 May 2025 20:23:11 -0400 Subject: [PATCH 35/96] Update header --- early-init.el | 14 +++++++++++--- init.el | 13 ++++++++++--- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/early-init.el b/early-init.el index 1fec3ac..8a39e3b 100644 --- a/early-init.el +++ b/early-init.el @@ -8,9 +8,17 @@ ;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Commentary: -;; The minimal-emacs.d project is a customizable base that provides better Emacs -;; defaults and optimized startup, intended to serve as a solid foundation for -;; your vanilla Emacs configuration. +;; 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. +;; +;; *Do not* modify this file; modify pre-early-init.el or post-early-init.el +;; instead. ;;; Code: diff --git a/init.el b/init.el index e78aa0c..3cf2a5a 100644 --- a/init.el +++ b/init.el @@ -8,9 +8,16 @@ ;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Commentary: -;; The minimal-emacs.d project is a customizable base that provides better Emacs -;; defaults and optimized startup, intended to serve as a solid foundation for -;; your vanilla Emacs configuration. +;; 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. +;; +;; *Do not* modify this file; modify pre-init.el or post-init.el instead. ;;; Code: From 6242e48e6bcbcf276db582a217f382698acb07b1 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 23 May 2025 20:27:21 -0400 Subject: [PATCH 36/96] Update header --- early-init.el | 4 ++-- init.el | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/early-init.el b/early-init.el index 8a39e3b..b039bd7 100644 --- a/early-init.el +++ b/early-init.el @@ -17,8 +17,8 @@ ;; extensive research and testing to fine-tune the best parameters and ;; optimizations for an Emacs configuration. ;; -;; *Do not* modify this file; modify pre-early-init.el or post-early-init.el -;; instead. +;; Do not modify this file; instead, modify pre-early-init.el or +;; post-early-init.el. ;;; Code: diff --git a/init.el b/init.el index 3cf2a5a..aeedf37 100644 --- a/init.el +++ b/init.el @@ -17,7 +17,7 @@ ;; extensive research and testing to fine-tune the best parameters and ;; optimizations for an Emacs configuration. ;; -;; *Do not* modify this file; modify pre-init.el or post-init.el instead. +;; Do not modify this file; instead, modify pre-init.el or post-init.el. ;;; Code: From 50ba20da9624f34e4d49a04a3c00c046e569ee09 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 26 May 2025 10:30:29 -0400 Subject: [PATCH 37/96] Update README.md --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 54b76d9..5c81f4c 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's - [Enhancing the Elisp development experience](#enhancing-the-elisp-development-experience) - [Showing the tab-bar](#showing-the-tab-bar) - [Preventing Emacs from saving custom.el](#preventing-emacs-from-saving-customel) + - [Changing the Default Font](#changing-the-default-font) - [Which other customizations can be interesting to add?](#which-other-customizations-can-be-interesting-to-add) - [Customizations: pre-early-init.el](#customizations-pre-early-initel) - [Reducing clutter in `~/.emacs.d` by redirecting files to `~/.emacs.d/var/`](#reducing-clutter-in-emacsd-by-redirecting-files-to-emacsdvar) @@ -982,6 +983,19 @@ To prevent Emacs from saving customization information to a custom file, set `cu (setq custom-file null-device) ``` +### Changing the Default Font + +To customize the default font, add the following expression to your `~/.emacs.d/post-init.el`: + +```elisp +(set-face-attribute 'default nil + :height 130 :weight 'light :family "DejaVu Sans Mono") +``` + +- Modify the `:family` value to specify a different font, according to your preference. You can replace it with, for example, "Iosevka Mono", "Iosevka Term", "Inconsolata", "JetBrains Mono", "Source Code Pro", "Hack". (The authors preferred font is "Iosevka Mono", medium weight.) +- Modify the `':weight`' value to control the font thickness/boldness. It must be one of the following symbols: `'ultra-heavy`, `'heavy` (a.k.a. `'black`), `'ultra-bold` (a.k.a. `'extra-bold`), `'bold`, `'semi-bold` (a.k.a. `'demi-bold`), `'medium`, `'normal` (a.k.a. `'regular`, a.k.a. `'book`), `'semi-light` (a.k.a. `'demi-light`), `'light`, `'extra-light` (a.k.a. `'ultra-light`), or `'thin`. +- Modify the :height value to set the font size, where 100 corresponds to 10 pt, 130 to 13 pt, and so on. + ### Which other customizations can be interesting to add? 1. Read the following article from the same author: [Essential Emacs Packages for Efficient Software Development and Text Editing](https://www.jamescherti.com/essential-emacs-packages/) From 311277e78e26a89ccdcfcbc579d5976424647b1a Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 26 May 2025 10:32:04 -0400 Subject: [PATCH 38/96] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c81f4c..99ee50c 100644 --- a/README.md +++ b/README.md @@ -989,7 +989,7 @@ To customize the default font, add the following expression to your `~/.emacs.d/ ```elisp (set-face-attribute 'default nil - :height 130 :weight 'light :family "DejaVu Sans Mono") + :height 130 :weight 'normal :family "DejaVu Sans Mono") ``` - Modify the `:family` value to specify a different font, according to your preference. You can replace it with, for example, "Iosevka Mono", "Iosevka Term", "Inconsolata", "JetBrains Mono", "Source Code Pro", "Hack". (The authors preferred font is "Iosevka Mono", medium weight.) From 50e26846326175e36694bd3fb860f0a92a737b00 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 26 May 2025 10:42:20 -0400 Subject: [PATCH 39/96] Update README.md --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 99ee50c..edd84e5 100644 --- a/README.md +++ b/README.md @@ -992,10 +992,15 @@ To customize the default font, add the following expression to your `~/.emacs.d/ :height 130 :weight 'normal :family "DejaVu Sans Mono") ``` -- Modify the `:family` value to specify a different font, according to your preference. You can replace it with, for example, "Iosevka Mono", "Iosevka Term", "Inconsolata", "JetBrains Mono", "Source Code Pro", "Hack". (The authors preferred font is "Iosevka Mono", medium weight.) +- Modify the `:family` value to specify a different font, according to your preference. You can replace it with, for example, "Iosevka Term", "Iosevka Term", "Inconsolata", "JetBrains Mono", "Source Code Pro", "Hack". (The authors preferred font is "Iosevka Mono", medium weight.) - Modify the `':weight`' value to control the font thickness/boldness. It must be one of the following symbols: `'ultra-heavy`, `'heavy` (a.k.a. `'black`), `'ultra-bold` (a.k.a. `'extra-bold`), `'bold`, `'semi-bold` (a.k.a. `'demi-bold`), `'medium`, `'normal` (a.k.a. `'regular`, a.k.a. `'book`), `'semi-light` (a.k.a. `'demi-light`), `'light`, `'extra-light` (a.k.a. `'ultra-light`), or `'thin`. - Modify the :height value to set the font size, where 100 corresponds to 10 pt, 130 to 13 pt, and so on. +On Linux, you can display a comprehensive list of all installed font families by executing the following command: +``` +fc-list : family | sort -u +``` + ### Which other customizations can be interesting to add? 1. Read the following article from the same author: [Essential Emacs Packages for Efficient Software Development and Text Editing](https://www.jamescherti.com/essential-emacs-packages/) From 25f057af22a7693e7231e4c2e13e8131e61926da Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 26 May 2025 10:45:56 -0400 Subject: [PATCH 40/96] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index edd84e5..eadc57f 100644 --- a/README.md +++ b/README.md @@ -992,13 +992,13 @@ To customize the default font, add the following expression to your `~/.emacs.d/ :height 130 :weight 'normal :family "DejaVu Sans Mono") ``` -- Modify the `:family` value to specify a different font, according to your preference. You can replace it with, for example, "Iosevka Term", "Iosevka Term", "Inconsolata", "JetBrains Mono", "Source Code Pro", "Hack". (The authors preferred font is "Iosevka Mono", medium weight.) +- Modify the `:family` value to specify a different font, according to your preference. You can replace it with, for example, "Iosevka Term", "Inconsolata", "JetBrains Mono", "Source Code Pro", "Hack". (The authors preferred font is "Iosevka Mono", medium weight.) - Modify the `':weight`' value to control the font thickness/boldness. It must be one of the following symbols: `'ultra-heavy`, `'heavy` (a.k.a. `'black`), `'ultra-bold` (a.k.a. `'extra-bold`), `'bold`, `'semi-bold` (a.k.a. `'demi-bold`), `'medium`, `'normal` (a.k.a. `'regular`, a.k.a. `'book`), `'semi-light` (a.k.a. `'demi-light`), `'light`, `'extra-light` (a.k.a. `'ultra-light`), or `'thin`. - Modify the :height value to set the font size, where 100 corresponds to 10 pt, 130 to 13 pt, and so on. On Linux, you can display a comprehensive list of all installed font families by executing the following command: ``` -fc-list : family | sort -u +fc-list : family | sed 's/,/\n/g' | sort -u ``` ### Which other customizations can be interesting to add? From e5ca0018399090dc2ec82baccf0be958e440ec14 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 26 May 2025 10:46:53 -0400 Subject: [PATCH 41/96] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eadc57f..f689bca 100644 --- a/README.md +++ b/README.md @@ -992,7 +992,7 @@ To customize the default font, add the following expression to your `~/.emacs.d/ :height 130 :weight 'normal :family "DejaVu Sans Mono") ``` -- Modify the `:family` value to specify a different font, according to your preference. You can replace it with, for example, "Iosevka Term", "Inconsolata", "JetBrains Mono", "Source Code Pro", "Hack". (The authors preferred font is "Iosevka Mono", medium weight.) +- Modify the `:family` value to specify a different font, according to your preference. You can replace it with, for example, "Iosevka Term", "Inconsolata", "JetBrains Mono", "Source Code Pro", "Hack". (The authors preferred font is "Iosevka Term", medium weight.) - Modify the `':weight`' value to control the font thickness/boldness. It must be one of the following symbols: `'ultra-heavy`, `'heavy` (a.k.a. `'black`), `'ultra-bold` (a.k.a. `'extra-bold`), `'bold`, `'semi-bold` (a.k.a. `'demi-bold`), `'medium`, `'normal` (a.k.a. `'regular`, a.k.a. `'book`), `'semi-light` (a.k.a. `'demi-light`), `'light`, `'extra-light` (a.k.a. `'ultra-light`), or `'thin`. - Modify the :height value to set the font size, where 100 corresponds to 10 pt, 130 to 13 pt, and so on. From 765f9f13d22d62610de3563b36fd53422fc66f48 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 26 May 2025 10:49:30 -0400 Subject: [PATCH 42/96] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f689bca..383c19d 100644 --- a/README.md +++ b/README.md @@ -992,9 +992,9 @@ To customize the default font, add the following expression to your `~/.emacs.d/ :height 130 :weight 'normal :family "DejaVu Sans Mono") ``` -- Modify the `:family` value to specify a different font, according to your preference. You can replace it with, for example, "Iosevka Term", "Inconsolata", "JetBrains Mono", "Source Code Pro", "Hack". (The authors preferred font is "Iosevka Term", medium weight.) - Modify the `':weight`' value to control the font thickness/boldness. It must be one of the following symbols: `'ultra-heavy`, `'heavy` (a.k.a. `'black`), `'ultra-bold` (a.k.a. `'extra-bold`), `'bold`, `'semi-bold` (a.k.a. `'demi-bold`), `'medium`, `'normal` (a.k.a. `'regular`, a.k.a. `'book`), `'semi-light` (a.k.a. `'demi-light`), `'light`, `'extra-light` (a.k.a. `'ultra-light`), or `'thin`. - Modify the :height value to set the font size, where 100 corresponds to 10 pt, 130 to 13 pt, and so on. +- Modify the `:family` value to specify a different font, according to your preference. You can replace it with, for example, "Iosevka Term", "Inconsolata", "JetBrains Mono", "Source Code Pro", or "Hack". (The authors preferred font family is "Iosevka Term", medium weight.) On Linux, you can display a comprehensive list of all installed font families by executing the following command: ``` From bd9dc5c1912cc412d57de1909e2c7c1e4de54e41 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 26 May 2025 10:50:56 -0400 Subject: [PATCH 43/96] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 383c19d..9ee3304 100644 --- a/README.md +++ b/README.md @@ -1158,7 +1158,7 @@ Add to `~/.emacs.d/pre-early-init.el`: And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=readme-ov-file#installer) to `~/.emacs.d/pre-init.el`: ```elisp -(defvar elpaca-installer-version 0.10) +(defvar elpaca-installer-version 0.11) (defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) (defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) (defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory)) @@ -1193,7 +1193,7 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read (unless (require 'elpaca-autoloads nil t) (require 'elpaca) (elpaca-generate-autoloads "elpaca" repo) - (load "./elpaca-autoloads"))) + (let ((load-source-file-function nil)) (load "./elpaca-autoloads")))) (add-hook 'after-init-hook #'elpaca-process-queues) (elpaca `(,@elpaca-order)) From f7be2f04d46d371b20d0db85b88c71287201e952 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 26 May 2025 13:08:36 -0400 Subject: [PATCH 44/96] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9ee3304..afc6da1 100644 --- a/README.md +++ b/README.md @@ -1158,6 +1158,7 @@ Add to `~/.emacs.d/pre-early-init.el`: And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=readme-ov-file#installer) to `~/.emacs.d/pre-init.el`: ```elisp +;; Elpaca bootstrap (defvar elpaca-installer-version 0.11) (defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) (defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) From 0564a726ddd8928fd2b895703fd25b1c2234461a Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Thu, 29 May 2025 13:22:29 -0400 Subject: [PATCH 45/96] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index afc6da1..00bc4f7 100644 --- a/README.md +++ b/README.md @@ -1420,6 +1420,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) +- [smahm006 minimal-emacs.d configuration](https://github.com/smahm006/minimal-emacs.d) + Please share your configuration. It could serve as inspiration for other users. ## Features From 43bddf4e7df13f5bdbb633bee5b016142be2b451 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 7 Jun 2025 12:09:39 -0400 Subject: [PATCH 46/96] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 00bc4f7..e2e0df6 100644 --- a/README.md +++ b/README.md @@ -353,9 +353,8 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E (use-package vertico ;; (Note: It is recommended to also enable the savehist package.) :ensure t - :defer t - :commands vertico-mode - :hook (after-init . vertico-mode)) + :config + (vertico-mode)) (use-package orderless ;; Vertico leverages Orderless' flexible matching capabilities, allowing users From 2520209eb142f4202d9e4aec4447569db18fb285 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 7 Jun 2025 12:29:11 -0400 Subject: [PATCH 47/96] Update README.md --- README.md | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index e2e0df6..68b766f 100644 --- a/README.md +++ b/README.md @@ -305,7 +305,6 @@ To configure `corfu` and `cape`, add the following to `~/.emacs.d/post-init.el`: ``` emacs-lisp (use-package corfu :ensure t - :defer t :commands (corfu-mode global-corfu-mode) :hook ((prog-mode . corfu-mode) @@ -325,7 +324,6 @@ To configure `corfu` and `cape`, add the following to `~/.emacs.d/post-init.el`: (use-package cape :ensure t - :defer t :commands (cape-dabbrev cape-file cape-elisp-block) :bind ("C-c p" . cape-prefix-map) :init @@ -371,7 +369,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. :ensure t - :defer t :commands (marginalia-mode marginalia-cycle) :hook (after-init . marginalia-mode)) @@ -380,7 +377,6 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E ;; users to perform context-sensitive actions on selected items ;; directly from the completion interface. :ensure t - :defer t :commands (embark-act embark-dwim embark-export @@ -505,7 +501,6 @@ For folding based on indentation levels, the **[outline-indent](https://github.c ```elisp (use-package outline-indent :ensure t - :defer t :commands outline-indent-minor-mode :custom @@ -578,7 +573,6 @@ To enable **stripspace** and automatically delete trailing whitespace, add the f ```elisp (use-package stripspace :ensure t - :defer t :commands stripspace-local-mode ;; Enable for prog-mode-hook, text-mode-hook, conf-mode-hook @@ -616,7 +610,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 - :defer t + :ensure t :commands (undo-fu-only-undo undo-fu-only-redo undo-fu-only-redo-all @@ -629,7 +623,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 - :defer t + :ensure t :commands undo-fu-session-global-mode :hook (after-init . undo-fu-session-global-mode)) ``` @@ -651,7 +645,6 @@ Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency ;; Vim emulation (use-package evil :ensure t - :defer t :commands (evil-mode evil-define-key) :hook (after-init . evil-mode)) @@ -680,7 +673,6 @@ The `evil-surround` package simplifies handling surrounding characters, such as (use-package evil-surround :after evil :ensure t - :defer t :commands global-evil-surround-mode :custom (evil-surround-pairs-alist @@ -715,7 +707,6 @@ To configure `eglot`, add the following to `~/.emacs.d/post-init.el`: ``` emacs-lisp (use-package eglot :ensure nil - :defer t :commands (eglot eglot-ensure eglot-rename @@ -754,7 +745,6 @@ To configure **easysession**, add the following to `~/.emacs.d/post-init.el`: ``` emacs-lisp (use-package easysession :ensure t - :defer t :commands (easysession-switch-to easysession-save-as easysession-save-mode @@ -785,7 +775,6 @@ To configure **org-mode**, add the following to `~/.emacs.d/post-init.el`: ```elisp (use-package org :ensure t - :defer t :commands (org-mode org-version) :mode ("\\.org\\'" . org-mode) @@ -829,7 +818,6 @@ To configure **flyspell**, add the following to `~/.emacs.d/post-init.el`: ``` emacs-lisp (use-package ispell :ensure nil - :defer t :commands (ispell ispell-minor-mode) :custom ;; Set the ispell program name to aspell @@ -843,7 +831,6 @@ To configure **flyspell**, add the following to `~/.emacs.d/post-init.el`: (use-package flyspell :ensure nil - :defer t :commands flyspell-mode :hook ((prog-mode . flyspell-prog-mode) @@ -875,7 +862,6 @@ To configure **apheleia**, add the following to `~/.emacs.d/post-init.el`: ```elisp (use-package apheleia :ensure t - :defer t :commands (apheleia-mode apheleia-global-mode) :hook ((prog-mode . apheleia-mode))) @@ -888,7 +874,7 @@ Helpful is an alternative to the built-in Emacs help that provides much more con To configure **helpful**, add the following to `~/.emacs.d/post-init.el`: ```emacs-lisp (use-package helpful - :defer t + :ensure t :commands (helpful-callable helpful-variable helpful-key @@ -912,7 +898,6 @@ To enhance the Elisp development experience, add the following to `~/.emacs.d/po ;; Enables automatic indentation of code while typing (use-package aggressive-indent :ensure t - :defer t :commands aggressive-indent-mode :hook (emacs-lisp-mode . aggressive-indent-mode)) @@ -920,7 +905,6 @@ To enhance the Elisp development experience, add the following to `~/.emacs.d/po ;; Highlights function and variable definitions in Emacs Lisp mode (use-package highlight-defined :ensure t - :defer t :commands highlight-defined-mode :hook (emacs-lisp-mode . highlight-defined-mode)) @@ -931,7 +915,6 @@ Other optional packages that may be useful include: ;; Prevent parenthesis imbalance (use-package paredit :ensure t - :defer t :commands paredit-mode :hook (emacs-lisp-mode . paredit-mode) @@ -942,7 +925,6 @@ Other optional packages that may be useful include: ;; -------------------------------------------------------------------------- ;; (use-package enhanced-evil-paredit ;; :ensure t -;; :defer t ;; :commands enhanced-evil-paredit-mode ;; :hook ;; (paredit-mode . enhanced-evil-paredit-mode)) @@ -950,7 +932,6 @@ Other optional packages that may be useful include: ;; Displays visible indicators for page breaks (use-package page-break-lines :ensure t - :defer t :commands (page-break-lines-mode global-page-break-lines-mode) :hook @@ -960,7 +941,6 @@ Other optional packages that may be useful include: ;; special forms, and symbols in Emacs Lisp (use-package elisp-refs :ensure t - :defer t :commands (elisp-refs-function elisp-refs-macro elisp-refs-variable @@ -1019,7 +999,6 @@ fc-list : family | sed 's/,/\n/g' | sort -u (use-package which-key :ensure nil ; builtin - :defer t :commands which-key-mode :hook (after-init . which-key-mode) :custom From ee6284e23197427b18397dbea0315edce179c4e7 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 7 Jun 2025 12:39:38 -0400 Subject: [PATCH 48/96] Update README.md --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 68b766f..b01c896 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's - [Which other customizations can be interesting to add?](#which-other-customizations-can-be-interesting-to-add) - [Customizations: pre-early-init.el](#customizations-pre-early-initel) - [Reducing clutter in `~/.emacs.d` by redirecting files to `~/.emacs.d/var/`](#reducing-clutter-in-emacsd-by-redirecting-files-to-emacsdvar) - - [Configuring straight.el?](#configuring-straightel) + - [Configuring straight.el](#configuring-straightel) - [Configuring elpaca (package manager)](#configuring-elpaca-package-manager) - [Frequently asked questions](#frequently-asked-questions) - [Customizing Scroll Recentering](#customizing-scroll-recentering) @@ -251,7 +251,9 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already (add-hook 'after-init-hook #'(lambda() (let ((inhibit-message t)) (recentf-mode 1)))) -(add-hook 'kill-emacs-hook #'recentf-cleanup) + +(with-eval-after-load "recentf" + (add-hook 'kill-emacs-hook #'recentf-cleanup)) ;; savehist is an Emacs feature that preserves the minibuffer history between ;; sessions. It saves the history of inputs in the minibuffer, such as commands, @@ -1102,7 +1104,9 @@ 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. -### Configuring straight.el? +### 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. [Add the straight.el bootstrap code](https://github.com/radian-software/straight.el?tab=readme-ov-file#getting-started) to `~/.emacs.d/pre-init.el`: ``` emacs-lisp @@ -1126,6 +1130,8 @@ An alternative lightweight approach is to simply change the default `~/.emacs.d` ### Configuring elpaca (package manager) +Elpaca is a modern, asynchronous package manager for Emacs designed to be a drop-in replacement for `package.el` and `straight.el`, with enhanced performance and flexibility. Unlike traditional Emacs package managers, Elpaca installs packages asynchronously, allowing Emacs to remain responsive during installation and updates. + Add to `~/.emacs.d/pre-early-init.el`: ```elisp ;; By default, minimal-emacs-package-initialize-and-refresh is set to t, which From cc03bf553666a59f4d08b5dfae02ab9cc7e14e1e Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 7 Jun 2025 12:50:15 -0400 Subject: [PATCH 49/96] Update README.md --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index b01c896..4869289 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's - [Configuring LSP Servers with Eglot (built-in)](#configuring-lsp-servers-with-eglot-built-in) - [Session Management](#session-management) - [Configuring org-mode](#configuring-org-mode) + - [Configuring `markdown-mode` (e.g., README.md syntax)](#configuring-markdown-mode-eg-readmemd-syntax) - [Inhibit the mouse](#inhibit-the-mouse) - [Spell checker](#spell-checker) - [Asynchronous code formatting without cursor disruption](#asynchronous-code-formatting-without-cursor-disruption) @@ -773,6 +774,8 @@ To configure **easysession**, add the following to `~/.emacs.d/post-init.el`: ### 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 (use-package org @@ -792,6 +795,30 @@ To configure **org-mode**, add the following to `~/.emacs.d/post-init.el`: (org-fontify-quote-and-verse-blocks t)) ``` +### 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). + +To configure **markdown-mode**, add the following to `~/.emacs.d/post-init.el`: +```elisp +(use-package markdown-mode + :commands (gfm-mode + gfm-view-mode + markdown-mode + markdown-view-mode) + :mode (("\\.markdown\\'" . markdown-mode) + ("\\.md\\'" . markdown-mode) + ("README\\.md\\'" . gfm-mode)) + :init + (setq markdown-command "multimarkdown") + + :bind + (:map markdown-mode-map + ("C-c C-e" . markdown-do))) +``` + +This configuration sets up `markdown-mode` with deferred loading to improve startup performance. The `:commands` and `:mode` keywords ensure that the mode is loaded only when needed—for example, when opening `.md`, `.markdown`, or `README.md` files. Files named `README.md` are specifically associated with `gfm-mode`, which is for GitHub Flavored Markdown syntax. The `markdown-command` variable is set to `"multimarkdown"` to specify the Markdown processor used for previews and exports. Additionally, a keybinding (`C-c C-e`) is defined in `markdown-mode-map` to invoke `markdown-do`, which can be customized to perform common Markdown-related actions. + ### Inhibit the mouse The [inhibit-mouse](https://github.com/jamescherti/inhibit-mouse.el) package disables mouse input in Emacs. From 066a6d84e7b6f8fc7c05660d778384c0fba9e167 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 7 Jun 2025 13:25:35 -0400 Subject: [PATCH 50/96] Update README.md --- README.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4869289..6779db6 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,8 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's - [Configuring LSP Servers with Eglot (built-in)](#configuring-lsp-servers-with-eglot-built-in) - [Session Management](#session-management) - [Configuring org-mode](#configuring-org-mode) - - [Configuring `markdown-mode` (e.g., README.md syntax)](#configuring-markdown-mode-eg-readmemd-syntax) + - [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) - [Inhibit the mouse](#inhibit-the-mouse) - [Spell checker](#spell-checker) - [Asynchronous code formatting without cursor disruption](#asynchronous-code-formatting-without-cursor-disruption) @@ -795,7 +796,7 @@ To configure **org-mode**, add the following to `~/.emacs.d/post-init.el`: (org-fontify-quote-and-verse-blocks t)) ``` -### Configuring `markdown-mode` (e.g., README.md syntax) +### 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). @@ -819,6 +820,24 @@ To configure **markdown-mode**, add the following to `~/.emacs.d/post-init.el`: This configuration sets up `markdown-mode` with deferred loading to improve startup performance. The `:commands` and `:mode` keywords ensure that the mode is loaded only when needed—for example, when opening `.md`, `.markdown`, or `README.md` files. Files named `README.md` are specifically associated with `gfm-mode`, which is for GitHub Flavored Markdown syntax. The `markdown-command` variable is set to `"multimarkdown"` to specify the Markdown processor used for previews and exports. Additionally, a keybinding (`C-c C-e`) is defined in `markdown-mode-map` to invoke `markdown-do`, which can be customized to perform common Markdown-related actions. +### Tree-sitter Integration (Better Syntax Highlighting) + +Tree-sitter in Emacs 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 +(use-package treesit-auto + :ensure t + :custom + (treesit-auto-install 'prompt) + :config + (treesit-auto-add-to-auto-mode-alist 'all) + (global-treesit-auto-mode)) +``` + ### Inhibit the mouse The [inhibit-mouse](https://github.com/jamescherti/inhibit-mouse.el) package disables mouse input in Emacs. From e246dfa0b6cf15fa24bd3eb4037f0ae192b57e10 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 7 Jun 2025 13:29:11 -0400 Subject: [PATCH 51/96] Update README.md --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6779db6..5e78888 100644 --- a/README.md +++ b/README.md @@ -711,8 +711,7 @@ To configure `eglot`, add the following to `~/.emacs.d/post-init.el`: ``` emacs-lisp (use-package eglot :ensure nil - :commands (eglot - eglot-ensure + :commands (eglot-ensure eglot-rename eglot-format-buffer)) ``` @@ -737,8 +736,8 @@ Here is an example of how to configure Eglot to enable or disable certain option :yapf (:enabled :json-false) :rope_autoimport (:enabled :json-false))))) -(add-hook 'python-mode-hook #'eglot) -(add-hook 'python-ts-mode-hook #'eglot) +(add-hook 'python-mode-hook #'eglot-ensure) +(add-hook 'python-ts-mode-hook #'eglot-ensure) ``` ### Session Management From 34f2ab8b888330c9d8b1dc3c4ffc0b9c84d9d805 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 7 Jun 2025 14:38:16 -0400 Subject: [PATCH 52/96] Update README.md --- README.md | 102 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 90 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 5e78888..6051fb8 100644 --- a/README.md +++ b/README.md @@ -207,6 +207,10 @@ Native compilation enhances Emacs performance by converting Elisp code into nati 2. Ensure all libraries are byte-compiled and native-compiled using [compile-angel.el](https://github.com/jamescherti/compile-angel.el). To install compile-angel, add the following code at the very beginning of your `~/.emacs.d/post-init.el` file, before all other packages: ```emacs-lisp +;; Native compilation enhances Emacs performance by converting Elisp code into +;; native machine code, resulting in faster execution and improved +;; responsiveness. +;; ;; 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 @@ -293,6 +297,15 @@ When `auto-save-visited-mode` is enabled, Emacs will auto-save file-visiting buf This is different from `auto-save-mode`: `auto-save-mode` periodically saves all modified buffers, creating backup files, including those not associated with a file, while `auto-save-visited-mode` only saves file-visiting buffers after a period of idle time, directly saving to the file itself without creating backup files. ``` emacs-lisp +;; When auto-save-visited-mode is enabled, Emacs will auto-save file-visiting +;; buffers after a certain amount of idle time if the user forgets to save it +;; with save-buffer or C-x s for example. +;; +;; This is different from auto-save-mode: auto-save-mode periodically saves +;; all modified buffers, creating backup files, including those not associated +;; with a file, while auto-save-visited-mode only saves file-visiting buffers +;; after a period of idle time, directly saving to the file itself without +;; creating backup files. (setq auto-save-visited-interval 5) ; Save after 5 seconds if inactivity (auto-save-visited-mode 1) ``` @@ -307,6 +320,9 @@ Cape, or Completion At Point Extensions, extends the capabilities of in-buffer c To configure `corfu` and `cape`, add the following to `~/.emacs.d/post-init.el`: ``` emacs-lisp +;; 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. (use-package corfu :ensure t :commands (corfu-mode global-corfu-mode) @@ -326,6 +342,9 @@ To configure `corfu` and `cape`, add the following to `~/.emacs.d/post-init.el`: :config (global-corfu-mode)) +;; Cape, or Completion At Point Extensions, extends the capabilities of +;; in-buffer completion. It integrates with Corfu or the default completion UI, +;; by providing additional backends through completion-at-point-functions. (use-package cape :ensure t :commands (cape-dabbrev cape-file cape-elisp-block) @@ -352,30 +371,36 @@ Embark integrates with these tools to provide context-sensitive actions and quic Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and Embark: ``` emacs-lisp +;; Vertico provides a vertical completion interface, making it easier to +;; 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)) +;; Vertico leverages Orderless' flexible matching capabilities, allowing users +;; to input multiple patterns separated by spaces, which Orderless then +;; matches in any order against the candidates. (use-package orderless - ;; Vertico leverages Orderless' flexible matching capabilities, allowing users - ;; to input multiple patterns separated by spaces, which Orderless then - ;; matches in any order against the candidates. :ensure t :custom (completion-styles '(orderless basic)) (completion-category-defaults nil) (completion-category-overrides '((file (styles partial-completion))))) +;; Marginalia allows Embark to offer you preconfigured actions in more contexts. +;; In addition to that, Marginalia also enhances Vertico by adding rich +;; annotations to the completion candidates displayed in Vertico's interface. (use-package marginalia - ;; Marginalia allows Embark to offer you preconfigured actions in more contexts. - ;; In addition to that, Marginalia also enhances Vertico by adding rich - ;; annotations to the completion candidates displayed in Vertico's interface. :ensure t :commands (marginalia-mode marginalia-cycle) :hook (after-init . marginalia-mode)) +;; Embark integrates with Consult and Vertico to provide context-sensitive +;; actions and quick access to commands based on the current selection, further +;; improving user efficiency and workflow within Emacs. Together, they create a +;; cohesive and powerful environment for managing completions and interactions. (use-package embark ;; Embark is an Emacs package that acts like a context menu, allowing ;; users to perform context-sensitive actions on selected items @@ -407,6 +432,8 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E :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' @@ -503,6 +530,10 @@ For example, to enable `outline-minor-mode` in Emacs Lisp: 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 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-indent :ensure t :commands outline-indent-minor-mode @@ -575,6 +606,9 @@ The [stripspace](https://github.com/jamescherti/stripspace.el) Emacs package pro 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 @@ -674,6 +708,11 @@ You can also use the [vim-tab-bar](https://github.com/jamescherti/vim-tab-bar.el The `evil-surround` package simplifies handling surrounding characters, such as parentheses, brackets, quotes, etc. It provides key bindings to easily add, change, or delete these surrounding characters in pairs. For instance, you can surround the currently selected text with double quotes in visual state using `S"` or `gS"`: ``` emacs-lisp +;; The evil-surround package simplifies handling surrounding characters, such as +;; parentheses, brackets, quotes, etc. It provides key bindings to easily add, +;; change, or delete these surrounding characters in pairs. For instance, you +;; can surround the currently selected text with double quotes in visual state +;; using S" or gS". (use-package evil-surround :after evil :ensure t @@ -695,6 +734,8 @@ The `evil-surround` package simplifies handling surrounding characters, such as You can also add the following code to enable commenting and uncommenting by pressing `gcc` in normal mode and `gc` in visual mode (thanks you to the Reddit user u/mistakenuser for this contribution, which replaces the evil-commentary package): ``` emacs-lisp +;; The following code enables commenting and uncommenting by pressing gcc in +;; normal mode and gc in visual mode. (with-eval-after-load "evil" (evil-define-operator my-evil-comment-or-uncomment (beg end) "Toggle comment for the region between BEG and END." @@ -705,10 +746,9 @@ You can also add the following code to enable commenting and uncommenting by pre ### Configuring LSP Servers with Eglot (built-in) -To set up Language Server Protocol (LSP) servers using Eglot, you can configure it in your Emacs setup as follows. This configuration ensures minimal disruption from Eglot's progress reporting and optimizes performance by disabling unnecessary logging. - -To configure `eglot`, add the following to `~/.emacs.d/post-init.el`: +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 @@ -719,6 +759,11 @@ To configure `eglot`, add the following to `~/.emacs.d/post-init.el`: 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` @@ -735,9 +780,6 @@ Here is an example of how to configure Eglot to enable or disable certain option :yapf (:enabled :json-false) :rope_autoimport (:enabled :json-false))))) - -(add-hook 'python-mode-hook #'eglot-ensure) -(add-hook 'python-ts-mode-hook #'eglot-ensure) ``` ### Session Management @@ -746,6 +788,12 @@ The [easysession](https://github.com/jamescherti/easysession.el) Emacs package i To configure **easysession**, add the following to `~/.emacs.d/post-init.el`: ``` emacs-lisp +;; The easysession 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. (use-package easysession :ensure t :commands (easysession-switch-to @@ -778,6 +826,11 @@ Org mode is a major mode designed for organizing notes, planning, task managemen 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) @@ -801,6 +854,10 @@ The [markdown-mode](https://github.com/jrblevin/markdown-mode) package provides To configure **markdown-mode**, add the following to `~/.emacs.d/post-init.el`: ```elisp +;; The 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). (use-package markdown-mode :commands (gfm-mode gfm-view-mode @@ -828,6 +885,11 @@ The configuration below enables Tree-sitter support using the [treesit-auto](htt 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 @@ -847,6 +909,11 @@ This package is useful for users who want to disable the mouse to: 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 @@ -876,6 +943,9 @@ To configure **flyspell**, add the following to `~/.emacs.d/post-init.el`: ;; 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 @@ -907,6 +977,8 @@ To maintain cursor stability, Apheleia generates an RCS patch, applies it select 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 @@ -920,6 +992,8 @@ Helpful is an alternative to the built-in Emacs help that provides much more con To configure **helpful**, add the following to `~/.emacs.d/post-init.el`: ```emacs-lisp +;; Helpful is an alternative to the built-in Emacs help that provides much more +;; contextual information. (use-package helpful :ensure t :commands (helpful-callable @@ -999,6 +1073,8 @@ Other optional packages that may be useful include: Configure the `tab-bar-show` variable to 1 to display the tab bar exclusively when multiple tabs are open: ```elisp +;; Configure the `tab-bar-show` variable to 1 to display the tab bar exclusively +;; when multiple tabs are open: (setopt tab-bar-show 1) ``` @@ -1006,6 +1082,7 @@ Configure the `tab-bar-show` variable to 1 to display the tab bar exclusively wh To prevent Emacs from saving customization information to a custom file, set `custom-file` to `null-device` by adding to the following to `~/.emacs.d/post-init.el`: ``` emacs-lisp +;; Prevent Emacs from saving customization information to a custom file (setq custom-file null-device) ``` @@ -1014,6 +1091,7 @@ To prevent Emacs from saving customization information to a custom file, set `cu To customize the default font, add the following expression to your `~/.emacs.d/post-init.el`: ```elisp +;; Set the default font to DejaVu Sans Mono with specific size and weight (set-face-attribute 'default nil :height 130 :weight 'normal :family "DejaVu Sans Mono") ``` From 89ad720f7e9350a9600b71c40e1f9dbf646cd244 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 1 Jun 2025 14:05:54 -0400 Subject: [PATCH 53/96] Add: which-func-update-delay --- init.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/init.el b/init.el index aeedf37..9aa23b7 100644 --- a/init.el +++ b/init.el @@ -38,11 +38,10 @@ (setq use-short-answers t) (advice-add 'yes-or-no-p :override #'y-or-n-p)) -;;; Undo/redo +;;; Features, warnings, and errors -(setq undo-limit (* 13 160000) - undo-strong-limit (* 13 240000) - undo-outer-limit (* 13 24000000)) +;; Disable warnings from the legacy advice API. They aren't useful. +(setq ad-redefinition-action 'accept) ;;; package.el @@ -58,10 +57,11 @@ ;; Ensure use-package is available (require 'use-package)) -;;; Features, warnings, and errors +;;; Undo/redo -;; Disable warnings from the legacy advice API. They aren't useful. -(setq ad-redefinition-action 'accept) +(setq undo-limit (* 13 160000) + undo-strong-limit (* 13 240000) + undo-outer-limit (* 13 24000000)) ;;; Minibuffer @@ -76,7 +76,8 @@ ;;; User interface ;; By default, Emacs "updates" its ui more often than it needs to -(setq idle-update-delay 1.0) +(setq which-func-update-delay 1.0) +(setq idle-update-delay which-func-update-delay) ;; Obsolete in >= 30.1 (defalias #'view-hello-file #'ignore) ; Never show the hello file From 3ff9a1915179b6c494b999edabde63dbbf48906e Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 1 Jun 2025 15:08:51 -0400 Subject: [PATCH 54/96] Update README.md --- README.md | 4 +++- init.el | 16 ++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6051fb8..23c59b3 100644 --- a/README.md +++ b/README.md @@ -1120,7 +1120,9 @@ fc-list : family | sed 's/,/\n/g' | sort -u (setq mode-line-position-column-line-format '("%l:%C")) ;; Display of line numbers in the buffer: -;; (display-line-numbers-mode 1) +(setq-default display-line-numbers-type 'relative) +(dolist (hook '(prog-mode-hook text-mode-hook conf-mode-hook)) + (add-hook hook #'display-line-numbers-mode)) (use-package which-key :ensure nil ; builtin diff --git a/init.el b/init.el index 9aa23b7..24bd740 100644 --- a/init.el +++ b/init.el @@ -43,6 +43,12 @@ ;; Disable warnings from the legacy advice API. They aren't useful. (setq ad-redefinition-action 'accept) +;;; Undo/redo + +(setq undo-limit (* 13 160000) + undo-strong-limit (* 13 240000) + undo-outer-limit (* 13 24000000)) + ;;; package.el (when (bound-and-true-p minimal-emacs-package-initialize-and-refresh) @@ -57,12 +63,6 @@ ;; Ensure use-package is available (require 'use-package)) -;;; Undo/redo - -(setq undo-limit (* 13 160000) - undo-strong-limit (* 13 240000) - undo-outer-limit (* 13 24000000)) - ;;; Minibuffer ;; Allow nested minibuffers @@ -462,8 +462,8 @@ (setq flyspell-issue-welcome-flag nil) -;; Greatly improves flyspell performance by preventing messages from being -;; displayed for each word when checking the entire buffer. +;; Improves flyspell performance by preventing messages from being displayed for +;; each word when checking the entire buffer. (setq flyspell-issue-message-flag nil) ;;; ispell From 9c6fd76524acee4bc92d70299ed61402d1fa601b Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 8 Jun 2025 18:25:05 -0400 Subject: [PATCH 55/96] Update README.md --- early-init.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/early-init.el b/early-init.el index b039bd7..b9ad89b 100644 --- a/early-init.el +++ b/early-init.el @@ -227,8 +227,13 @@ 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) - ;; Shave seconds off startup time by starting the scratch buffer in - ;; `fundamental-mode' + ;; 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) From eaf87000ac3bdfec154bbb6db2e1a351a6e4d664 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 8 Jun 2025 18:46:22 -0400 Subject: [PATCH 56/96] Declare package-archive-priorities using setq and other minor changes --- README.md | 8 ++++---- early-init.el | 16 ++++++++-------- init.el | 8 ++++---- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 23c59b3..bf9bd55 100644 --- a/README.md +++ b/README.md @@ -1381,10 +1381,10 @@ If you prefer MELPA Stable over MELPA, you can add MELPA Stable and prioritize i ;; This change increases MELPA Stable priority to 70, above MELPA, ;; ensuring that MELPA is preferred for package installations ;; over MELPA Stable. -(customize-set-variable 'package-archive-priorities '(("gnu" . 99) - ("nongnu" . 80) - ("melpa-stable" . 70) - ("melpa" . 0))) +(setq package-archive-priorities '(("gnu" . 99) + ("nongnu" . 80) + ("melpa-stable" . 70) + ("melpa" . 0))) ``` ### How to load a local lisp file for machine-specific configurations? diff --git a/early-init.el b/early-init.el index b9ad89b..e19a684 100644 --- a/early-init.el +++ b/early-init.el @@ -26,7 +26,7 @@ (defvar minimal-emacs-ui-features '() "List of user interface features to enable in minimal Emacs setup. -This variable holds a list Emacs UI features that can be enabled: +This variable holds a list of Emacs UI features that can be enabled: - context-menu (Enables the context menu in graphical environments.) - tool-bar (Enables the tool bar in graphical environments.) - menu-bar (Enables the menu bar in graphical environments.) @@ -39,15 +39,15 @@ This variable holds a list Emacs UI features that can be enabled: (defvar minimal-emacs-debug (bound-and-true-p init-file-debug) "Non-nil to enable debug.") -(defvar minimal-emacs-gc-cons-threshold (* 32 1024 1024) - "Value to set `gc-cons-threshold' to after Emacs startup. -Ignored if `minimal-emacs-optimize-startup-gc' is nil.") - (defvar minimal-emacs-optimize-startup-gc t "If non-nil, increase `gc-cons-threshold' during startup to reduce pauses. After Emacs finishes loading, `gc-cons-threshold' is restored to the value stored in `minimal-emacs--restore-gc-cons-threshold'.") +(defvar minimal-emacs-gc-cons-threshold (* 32 1024 1024) + "Value to which `gc-cons-threshold' is set after Emacs startup. +Ignored if `minimal-emacs-optimize-startup-gc' is nil.") + (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 @@ -432,9 +432,9 @@ this stage of initialization." (setq package-archives '(("melpa" . "https://melpa.org/packages/") ("gnu" . "https://elpa.gnu.org/packages/") ("nongnu" . "https://elpa.nongnu.org/nongnu/"))) -(customize-set-variable 'package-archive-priorities '(("gnu" . 99) - ("nongnu" . 80) - ("melpa" . 70))) +(setq package-archive-priorities '(("gnu" . 99) + ("nongnu" . 80) + ("melpa" . 70))) ;;; Load post-early-init.el (minimal-emacs-load-user-init "post-early-init.el") diff --git a/init.el b/init.el index 24bd740..07e17ec 100644 --- a/init.el +++ b/init.el @@ -104,7 +104,7 @@ ;;; Misc -(setq whitespace-line-column nil) ; whitespace-mode +(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) @@ -479,9 +479,9 @@ (setq ibuffer-formats '((mark modified read-only locked " " (name 40 40 :left :elide) - " " (size 8 -1 :right) - " " (mode 18 18 :left :elide) " " filename-and-process) - (mark " " (name 16 -1) " " filename))) + " " (size 8 -1 :right) + " " (mode 18 18 :left :elide) " " filename-and-process) + (mark " " (name 16 -1) " " filename))) ;;; xref From 93c96c7ed3f15b672fcb22a3471e30ab89216cd0 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 9 Jun 2025 23:54:54 -0400 Subject: [PATCH 57/96] When minimal-emacs-setup-native-compilation is nil, leave native-comp variables to their default values --- early-init.el | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/early-init.el b/early-init.el index e19a684..dda1a6c 100644 --- a/early-init.el +++ b/early-init.el @@ -74,11 +74,14 @@ 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 - "If non-nil, enable and configure native compilation. -When enabled, this variable sets the following: + "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' -- `package-native-compile'") +- `package-native-compile' +If nil, these variables are left at their default values and are not +modified during setup.") (defvar minimal-emacs-user-directory user-emacs-directory "The default value of the `user-emacs-directory' variable.") @@ -155,10 +158,11 @@ pre-early-init.el, and post-early-init.el.") (if (and (featurep 'native-compile) (fboundp 'native-comp-available-p) (native-comp-available-p)) - ;; Activate `native-compile' - (setq native-comp-deferred-compilation minimal-emacs-setup-native-compilation - native-comp-jit-compilation minimal-emacs-setup-native-compilation - package-native-compile minimal-emacs-setup-native-compilation) + (when minimal-emacs-setup-native-compilation + ;; Activate `native-compile' + (setq native-comp-deferred-compilation t + native-comp-jit-compilation t + package-native-compile t)) ;; Deactivate the `native-compile' feature if it is not available (setq features (delq 'native-compile features))) From b980ce1bc2275870f604824933725840c2f5bcd8 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 10 Jun 2025 14:03:10 -0400 Subject: [PATCH 58/96] Update README.md --- README.md | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 138 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bf9bd55..54788d3 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's - [Configuring org-mode](#configuring-org-mode) - [Configuring markdown-mode (e.g., README.md syntax)](#configuring-markdown-mode-eg-readmemd-syntax) - [Tree-sitter Integration (Better Syntax Highlighting)](#tree-sitter-integration-better-syntax-highlighting) + - [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) - [Asynchronous code formatting without cursor disruption](#asynchronous-code-formatting-without-cursor-disruption) @@ -878,7 +879,7 @@ This configuration sets up `markdown-mode` with deferred loading to improve star ### Tree-sitter Integration (Better Syntax Highlighting) -Tree-sitter in Emacs 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. +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. @@ -899,6 +900,142 @@ To enable Tree-sitter, add the following to your `~/.emacs.d/post-init.el`: (global-treesit-auto-mode)) ``` +### Treemacs, a tree layout file explorer (Sidebar file explorer) + +The [treemacs](https://github.com/Alexander-Miller/treemacs) package is a file and project explorer for Emacs that provides a visually structured tree layout similar to file browsers in modern IDEs. It integrates well with various Emacs packages such as `projectile`, `lsp-mode`, and `magit`, allowing users to navigate their project structure efficiently. + +[[file:]] + + +To configure **treemacs**, add the following to `~/.emacs.d/post-init.el`: +```elisp +(use-package treemacs + :commands (treemacs + treemacs-select-window + treemacs-delete-other-windows + treemacs-select-directory + treemacs-bookmark + treemacs-find-file + treemacs-find-tag) + + :bind + (:map global-map + ("M-0" . treemacs-select-window) + ("C-x t 1" . treemacs-delete-other-windows) + ("C-x t t" . treemacs) + ("C-x t d" . treemacs-select-directory) + ("C-x t B" . treemacs-bookmark) + ("C-x t C-t" . treemacs-find-file) + ("C-x t M-t" . treemacs-find-tag)) + + :init + (with-eval-after-load 'winum + (define-key winum-keymap (kbd "M-0") #'treemacs-select-window)) + + :config + (setq treemacs-collapse-dirs (if treemacs-python-executable 3 0) + treemacs-deferred-git-apply-delay 0.5 + treemacs-directory-name-transformer #'identity + treemacs-display-in-side-window t + treemacs-eldoc-display 'simple + treemacs-file-event-delay 2000 + treemacs-file-extension-regex treemacs-last-period-regex-value + treemacs-file-follow-delay 0.2 + treemacs-file-name-transformer #'identity + treemacs-follow-after-init t + treemacs-expand-after-init t + treemacs-find-workspace-method 'find-for-file-or-pick-first + treemacs-git-command-pipe "" + treemacs-goto-tag-strategy 'refetch-index + treemacs-header-scroll-indicators '(nil . "^^^^^^") + treemacs-hide-dot-git-directory t + treemacs-indentation 2 + treemacs-indentation-string " " + treemacs-is-never-other-window nil + treemacs-max-git-entries 5000 + treemacs-missing-project-action 'ask + treemacs-move-files-by-mouse-dragging t + treemacs-move-forward-on-expand nil + treemacs-no-png-images nil + treemacs-no-delete-other-windows t + treemacs-project-follow-cleanup nil + treemacs-persist-file (expand-file-name ".cache/treemacs-persist" user-emacs-directory) + treemacs-position 'left + treemacs-read-string-input 'from-child-frame + treemacs-recenter-distance 0.1 + treemacs-recenter-after-file-follow nil + treemacs-recenter-after-tag-follow nil + treemacs-recenter-after-project-jump 'always + treemacs-recenter-after-project-expand 'on-distance + treemacs-litter-directories '("/node_modules" "/.venv" "/.cask") + treemacs-project-follow-into-home nil + treemacs-show-cursor nil + treemacs-show-hidden-files t + treemacs-silent-filewatch nil + treemacs-silent-refresh nil + treemacs-sorting 'alphabetic-asc + treemacs-select-when-already-in-treemacs 'move-back + treemacs-space-between-root-nodes t + treemacs-tag-follow-cleanup t + treemacs-tag-follow-delay 1.5 + treemacs-text-scale nil + treemacs-user-mode-line-format nil + treemacs-user-header-line-format nil + treemacs-wide-toggle-width 70 + treemacs-width 35 + treemacs-width-increment 1 + treemacs-width-is-initially-locked t + treemacs-workspace-switch-cleanup nil) + + ;; The default width and height of the icons is 22 pixels. If you are + ;; using a Hi-DPI display, uncomment this to double the icon size. + ;; (treemacs-resize-icons 44) + + (treemacs-follow-mode t) + (treemacs-filewatch-mode t) + (treemacs-fringe-indicator-mode 'always) + + ;;(when treemacs-python-executable + ;; (treemacs-git-commit-diff-mode t)) + + (pcase (cons (not (null (executable-find "git"))) + (not (null treemacs-python-executable))) + (`(t . t) + (treemacs-git-mode 'deferred)) + (`(t . _) + (treemacs-git-mode 'simple))) + + (treemacs-hide-gitignored-files-mode nil)) + +;;(use-package treemacs-evil +;; :after (treemacs evil) +;; :ensure t) +;; +;; (use-package treemacs-projectile +;; :after (treemacs projectile) +;; :ensure t) +;; +;; (use-package treemacs-icons-dired +;; :hook (dired-mode . treemacs-icons-dired-enable-once) +;; :ensure t) +;; +;; (use-package treemacs-magit +;; :after (treemacs magit) +;; :ensure t) +;; +;; (use-package treemacs-persp ; treemacs-perspective if you use perspective.el vs. persp-mode +;; :after (treemacs persp-mode) ;;or perspective vs. persp-mode +;; :ensure t +;; :config (treemacs-set-scope-type 'Perspectives)) +;; +;;(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) +``` + ### Inhibit the mouse The [inhibit-mouse](https://github.com/jamescherti/inhibit-mouse.el) package disables mouse input in Emacs. From 758b66736e50b03db810906448b967cfef92ae29 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 10 Jun 2025 14:10:41 -0400 Subject: [PATCH 59/96] Update README.md --- README.md | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 54788d3..3fd86d4 100644 --- a/README.md +++ b/README.md @@ -909,7 +909,12 @@ The [treemacs](https://github.com/Alexander-Miller/treemacs) package is a file a To configure **treemacs**, add the following to `~/.emacs.d/post-init.el`: ```elisp +;; A file and project explorer for Emacs that displays a structured tree +;; layout, similar to file browsers in modern IDEs. It functions as a sidebar +;; 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 @@ -1007,31 +1012,18 @@ 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) -;; -;; (use-package treemacs-projectile -;; :after (treemacs projectile) +;; (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-magit -;; :after (treemacs magit) -;; :ensure t) -;; -;; (use-package treemacs-persp ; treemacs-perspective if you use perspective.el vs. persp-mode -;; :after (treemacs persp-mode) ;;or perspective vs. persp-mode +;; (use-package treemacs-tab-bar ; treemacs-tab-bar if you use tab-bar-mode +;; :after (treemacs) ;; :ensure t -;; :config (treemacs-set-scope-type 'Perspectives)) -;; -;;(use-package treemacs-tab-bar ; treemacs-tab-bar if you use tab-bar-mode -;; :after (treemacs) -;; :ensure t -;; :config (treemacs-set-scope-type 'Tabs)) +;; :config (treemacs-set-scope-type 'Tabs)) ;; ;; (treemacs-start-on-boot) ``` From cbe668e1338bd7ecb4b99b413b1f2c69a89ce415 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Thu, 12 Jun 2025 11:49:16 -0400 Subject: [PATCH 60/96] Add option to specify wait time before restoring gc-cons-threshold --- early-init.el | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/early-init.el b/early-init.el index dda1a6c..09e759a 100644 --- a/early-init.el +++ b/early-init.el @@ -22,6 +22,13 @@ ;;; Code: +;;; Internal variables + +(defvar minimal-emacs--backup-gc-cons-threshold gc-cons-threshold + "Backup of the original value of `gc-cons-threshold' before startup.") + +(setq gc-cons-threshold most-positive-fixnum) + ;;; Variables (defvar minimal-emacs-ui-features '() @@ -48,6 +55,9 @@ stored in `minimal-emacs--restore-gc-cons-threshold'.") "Value to which `gc-cons-threshold' is set after Emacs startup. Ignored if `minimal-emacs-optimize-startup-gc' is nil.") +(defvar minimal-emacs-gc-cons-threshold-restore-delay nil + "Number of seconds to wait before restoring `gc-cons-threshold'.") + (defvar minimal-emacs-inhibit-redisplay-during-startup nil "Suppress redisplay during startup to improve performance. This prevents visual updates while Emacs initializes. The tradeoff is that you @@ -146,12 +156,18 @@ pre-early-init.el, and post-early-init.el.") (setq garbage-collection-messages minimal-emacs-debug) (defun minimal-emacs--restore-gc-cons-threshold () - "Restore `minimal-emacs-gc-cons-threshold'." - (setq gc-cons-threshold minimal-emacs-gc-cons-threshold)) + "Restore `gc-cons-threshold' to `minimal-emacs-gc-cons-threshold'." + (if (bound-and-true-p minimal-emacs-gc-cons-threshold-restore-delay) + ;; Defer garbage collection during initialization to avoid 2 collections. + (run-at-time + minimal-emacs-gc-cons-threshold-restore-delay nil + (lambda () (setq gc-cons-threshold minimal-emacs-gc-cons-threshold))) + (setq gc-cons-threshold minimal-emacs-gc-cons-threshold))) -(when minimal-emacs-optimize-startup-gc - (setq gc-cons-threshold most-positive-fixnum) - (add-hook 'emacs-startup-hook #'minimal-emacs--restore-gc-cons-threshold 105)) +(if minimal-emacs-optimize-startup-gc + (add-hook 'emacs-startup-hook #'minimal-emacs--restore-gc-cons-threshold 105) + ;; The user chose not to modify `gc-cons-threshold'. + (setq gc-cons-threshold minimal-emacs--backup-gc-cons-threshold)) ;;; Native compilation and Byte compilation From 5bfdb6264be1c4d809e144006b4ecc78e3889429 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 13 Jun 2025 13:23:13 -0400 Subject: [PATCH 61/96] Enhance eglot defaults --- init.el | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/init.el b/init.el index 07e17ec..a5cb375 100644 --- a/init.el +++ b/init.el @@ -424,15 +424,26 @@ ;;; Eglot -(setq eglot-sync-connect 1 - eglot-autoshutdown t) +;; 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) ;; Eglot optimization -(setq eglot-events-buffer-size 0) -(setq eglot-report-progress nil) ; Prevent Eglot minibuffer spam +(if minimal-emacs-debug + (setq eglot-events-buffer-config '(:size 2000000 :format full)) + ;; This reduces log clutter to improves performance. + (setq jsonrpc-event-hook nil) + ;; Reduce memory usage and avoid cluttering *EGLOT events* buffer + (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 From 00e95a1534fff57a4654ebcf62252f9b55d603ba Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 13 Jun 2025 13:41:57 -0400 Subject: [PATCH 62/96] Remove flymake-fringe-indicator-position and flymake-suppress-zero-counters --- init.el | 4 ---- 1 file changed, 4 deletions(-) diff --git a/init.el b/init.el index a5cb375..2439f1d 100644 --- a/init.el +++ b/init.el @@ -447,12 +447,8 @@ ;;; Flymake -(setq flymake-fringe-indicator-position 'left-fringe) (setq flymake-show-diagnostics-at-end-of-line nil) -;; Suppress the display of Flymake error counters when there are no errors. -(setq flymake-suppress-zero-counters t) - ;; Disable wrapping around when navigating Flymake errors. (setq flymake-wrap-around nil) From af92a8be9f54052f22ac3acdc4e2781bec345244 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 13 Jun 2025 13:56:25 -0400 Subject: [PATCH 63/96] Add dabbrev-ignored-buffer-regexps --- init.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/init.el b/init.el index 2439f1d..51336a4 100644 --- a/init.el +++ b/init.el @@ -508,9 +508,17 @@ ;;; dabbrev (setq dabbrev-upcase-means-case-search t) + (setq dabbrev-ignored-buffer-modes '(archive-mode image-mode docview-mode tags-table-mode pdf-view-mode)) +(setq dabbrev-ignored-buffer-regexps + '(;; - Buffers starting with a space (internal or temporary buffers) + "\\` " + ;; Tags files such as ETAGS, GTAGS, RTAGS, TAGS, e?tags, and GPATH, + ;; including versions with numeric extensions like <123> + "\\(?:\\(?:[EG]?\\|GR\\)TAGS\\|e?tags\\|GPATH\\)\\(<[0-9]+>\\)?")) + ;;; Remove warnings from narrow-to-region, upcase-region... (dolist (cmd '(list-timers narrow-to-region upcase-region downcase-region From 0606abc7261e635a6f73ccced18957d092d27a9b Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 13 Jun 2025 14:35:55 -0400 Subject: [PATCH 64/96] Add custom-buffer-done-kill and remove next-error-recenter --- init.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/init.el b/init.el index 51336a4..94f397e 100644 --- a/init.el +++ b/init.el @@ -98,12 +98,10 @@ compilation-ask-about-save nil compilation-scroll-output 'first-error) -;; Recenter to the middle of the window for `compile-goto-error', which is also -;; used by `wgrep' and `embark-export'. -(setq next-error-recenter '(4)) - ;;; Misc +(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' From 991671323b9b01cd4bfabc8e7c7fd175a7eedcfb Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 13 Jun 2025 16:44:48 -0400 Subject: [PATCH 65/96] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3fd86d4..462bc74 100644 --- a/README.md +++ b/README.md @@ -1292,8 +1292,7 @@ fc-list : family | sed 's/,/\n/g' | sort -u :custom (uniquify-buffer-name-style 'reverse) (uniquify-separator "•") - (uniquify-after-kill-buffer-p t) - (uniquify-ignore-buffers-re "^\\*")) + (uniquify-after-kill-buffer-p t)) ;; Window dividers separate windows visually. Window dividers are bars that can ;; be dragged with the mouse, thus allowing you to easily resize adjacent @@ -1319,6 +1318,9 @@ fc-list : family | sed 's/,/\n/g' | sort -u "\\|^flymake_.*")) (add-hook 'dired-mode-hook #'dired-omit-mode) +;; Enables visual indication of minibuffer recursion depth after initialization. +(add-hook 'after-init-hook #'minibuffer-depth-indicate-mode) + ;; Configure Emacs to ask for confirmation before exiting (setq confirm-kill-emacs 'y-or-n-p) From 2a170f3f03f1164331a958adfa850fbf23bb1ec6 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 14 Jun 2025 14:25:05 -0400 Subject: [PATCH 66/96] Move frame-resize-pixelwise to early-init.el --- early-init.el | 4 ++++ init.el | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/early-init.el b/early-init.el index 09e759a..62d3115 100644 --- a/early-init.el +++ b/early-init.el @@ -218,6 +218,10 @@ pre-early-init.el, and post-early-init.el.") (setq inhibit-compacting-font-caches t) (when (and (not (daemonp)) (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) + ;; Without this, Emacs will try to resize itself to a specific column size (setq frame-inhibit-implied-resize t) diff --git a/init.el b/init.el index 94f397e..f9153e8 100644 --- a/init.el +++ b/init.el @@ -233,10 +233,6 @@ ;;; Frames and windows -;; 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) - ;; 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) From 931c0e9034af4a8c18cb00b2c36d35e175134d7a Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 14 Jun 2025 15:08:29 -0400 Subject: [PATCH 67/96] Add vc-git-diff-switches --- init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/init.el b/init.el index f9153e8..c08a5d4 100644 --- a/init.el +++ b/init.el @@ -168,6 +168,7 @@ (setq vc-git-print-log-follow t) (setq vc-make-backup-files nil) ; Do not backup version controlled files +(setq vc-git-diff-switches '("--histogram")) ; Faster algorithm for diffing. ;;; Auto save From 4d769e9b8be5e172267fd3b44c3d26ac480a9b41 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 15 Jun 2025 11:28:13 -0400 Subject: [PATCH 68/96] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 462bc74..a8eb02e 100644 --- a/README.md +++ b/README.md @@ -904,7 +904,6 @@ To enable Tree-sitter, add the following to your `~/.emacs.d/post-init.el`: The [treemacs](https://github.com/Alexander-Miller/treemacs) package is a file and project explorer for Emacs that provides a visually structured tree layout similar to file browsers in modern IDEs. It integrates well with various Emacs packages such as `projectile`, `lsp-mode`, and `magit`, allowing users to navigate their project structure efficiently. -[[file:]]  To configure **treemacs**, add the following to `~/.emacs.d/post-init.el`: From c695bfb9da114935442ad8d12f1551992be8cf61 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 15 Jun 2025 11:44:08 -0400 Subject: [PATCH 69/96] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a8eb02e..a0c7d35 100644 --- a/README.md +++ b/README.md @@ -842,11 +842,11 @@ To configure **org-mode**, add the following to `~/.emacs.d/post-init.el`: (org-startup-indented t) (org-adapt-indentation nil) (org-edit-src-content-indentation 0) - (org-startup-truncated t) - (org-fontify-done-headline t) - (org-fontify-todo-headline t) - (org-fontify-whole-heading-line t) - (org-fontify-quote-and-verse-blocks t)) + ;; (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)) ``` ### Configuring markdown-mode (e.g., README.md syntax) From 5be624f9733997c6f3a2619ea1d78d0f10907662 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 15 Jun 2025 12:27:27 -0400 Subject: [PATCH 70/96] Restore `gc-cons-threshold` only if the user has not overridden it. --- early-init.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/early-init.el b/early-init.el index 62d3115..a07624b 100644 --- a/early-init.el +++ b/early-init.el @@ -49,7 +49,7 @@ This variable holds a list of Emacs UI features that can be enabled: (defvar minimal-emacs-optimize-startup-gc t "If non-nil, increase `gc-cons-threshold' during startup to reduce pauses. After Emacs finishes loading, `gc-cons-threshold' is restored to the value -stored in `minimal-emacs--restore-gc-cons-threshold'.") +stored in `minimal-emacs-gc-cons-threshold'.") (defvar minimal-emacs-gc-cons-threshold (* 32 1024 1024) "Value to which `gc-cons-threshold' is set after Emacs startup. @@ -165,9 +165,13 @@ pre-early-init.el, and post-early-init.el.") (setq gc-cons-threshold minimal-emacs-gc-cons-threshold))) (if minimal-emacs-optimize-startup-gc + ;; `gc-cons-threshold' is managed by minimal-emacs.d (add-hook 'emacs-startup-hook #'minimal-emacs--restore-gc-cons-threshold 105) - ;; The user chose not to modify `gc-cons-threshold'. - (setq gc-cons-threshold minimal-emacs--backup-gc-cons-threshold)) + ;; gc-cons-threshold is not managed by minimal-emacs.d. + ;; If it is equal to `most-positive-fixnum', this indicates that the user has + ;; not overridden the value in their `pre-early-init.el' configuration. + (when (= gc-cons-threshold most-positive-fixnum) + (setq gc-cons-threshold minimal-emacs--backup-gc-cons-threshold))) ;;; Native compilation and Byte compilation From 0fe8b7d1de3f7b1d604fb7a4cab4cd25977095ae Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Jun 2025 10:26:12 -0400 Subject: [PATCH 71/96] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index a0c7d35..630efb5 100644 --- a/README.md +++ b/README.md @@ -505,6 +505,14 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E (setq xref-show-xrefs-function #'consult-xref xref-show-definitions-function #'consult-xref) + ;; Aggressive asynchronous that yield instantaneous results. (suitable for + ;; high-performance systems.) Note: Minad, the author of Consult, does not + ;; recommend aggressive values. + ;; Read: https://github.com/minad/consult/discussions/951 + ;; (setq consult-async-input-debounce 0.02 + ;; consult-async-input-throttle 0.05 + ;; consult-async-refresh-delay 0.02) + :config (consult-customize consult-theme :preview-key '(:debounce 0.2 any) From fd753d9d17b24eef61e26bca0e8a0cf3005887cd Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 18 Jun 2025 13:32:24 -0400 Subject: [PATCH 72/96] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 630efb5..8fecb86 100644 --- a/README.md +++ b/README.md @@ -509,6 +509,9 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E ;; high-performance systems.) Note: Minad, the author of Consult, does not ;; recommend aggressive values. ;; Read: https://github.com/minad/consult/discussions/951 + ;; + ;; However, the author of minimal-emacs.d uses these parameters to achieve + ;; immediate feedback from Consult. ;; (setq consult-async-input-debounce 0.02 ;; consult-async-input-throttle 0.05 ;; consult-async-refresh-delay 0.02) From c833048e696d33e4b7d0c796d4373daa5a1fc55c Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Thu, 26 Jun 2025 11:14:16 -0400 Subject: [PATCH 73/96] Update tab-first-completion and tab-always-indent --- init.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index c08a5d4..736570c 100644 --- a/init.el +++ b/init.el @@ -335,7 +335,8 @@ tab-width 4) ;; Enable indentation and completion using the TAB key -(setq-default tab-always-indent nil) +(setq tab-always-indent 'complete) +(setq tab-first-completion 'word-or-paren-or-punct) ;; Perf: Reduce command completion overhead. (setq read-extended-command-predicate #'command-completion-default-include-p) From 2b931b134cbab91c765c608911ec598165f30ac5 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Thu, 26 Jun 2025 11:25:04 -0400 Subject: [PATCH 74/96] Add electric-indent-chars --- init.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.el b/init.el index 736570c..ffe50cf 100644 --- a/init.el +++ b/init.el @@ -329,6 +329,10 @@ ;; when the window is narrower than `truncate-partial-width-windows' characters. (setq truncate-partial-width-windows nil) +;; Configure automatic indentation to be triggered exclusively by newline and +;; DEL (backspace) characters. +(setq-default electric-indent-chars '(?\n ?\^?)) + ;; Prefer spaces over tabs. Spaces offer a more consistent default compared to ;; 8-space tabs. This setting can be adjusted on a per-mode basis as needed. (setq-default indent-tabs-mode nil From 32902df61a58d409e0768bb93fcbdb4b3dbc8a4a Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Thu, 26 Jun 2025 11:44:13 -0400 Subject: [PATCH 75/96] Update ibuffer-formats --- init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.el b/init.el index ffe50cf..654e135 100644 --- a/init.el +++ b/init.el @@ -485,7 +485,7 @@ (setq ibuffer-formats '((mark modified read-only locked - " " (name 40 40 :left :elide) + " " (name 55 55 :left :elide) " " (size 8 -1 :right) " " (mode 18 18 :left :elide) " " filename-and-process) (mark " " (name 16 -1) " " filename))) From 691a293e58e380e25fd388d86a0113ed8d4930ea Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Thu, 26 Jun 2025 12:11:37 -0400 Subject: [PATCH 76/96] Add imenu-auto-rescan and imenu-max-item-length --- init.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/init.el b/init.el index 654e135..fed0e85 100644 --- a/init.el +++ b/init.el @@ -121,6 +121,13 @@ (setq tramp-completion-reread-directory-timeout 50) (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) + ;;; Files ;; Delete by moving to trash in interactive mode From 8b93ebc6c3c2f5c0ea3625b13aea4da2bd1459a6 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Thu, 26 Jun 2025 12:52:54 -0400 Subject: [PATCH 77/96] Add next-line-add-newlines and pgtk-wait-for-event-timeout --- init.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/init.el b/init.el index fed0e85..2644ab7 100644 --- a/init.el +++ b/init.el @@ -85,6 +85,11 @@ (setq visible-bell nil) (setq ring-bell-function #'ignore) +;; In PGTK, this timeout introduces latency. Reducing it from the default 0.1 +;; improves responsiveness of childframes and related packages. +(when (boundp 'pgtk-wait-for-event-timeout) + (setq pgtk-wait-for-event-timeout 0.001)) + ;;; Show-paren (setq show-paren-delay 0.1 @@ -128,6 +133,9 @@ ;; 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) + ;;; Files ;; Delete by moving to trash in interactive mode From 66788d1045f5e728346603229f3a66480223bc8d Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 27 Jun 2025 14:28:46 -0400 Subject: [PATCH 78/96] Add dired-auto-revert-buffer --- init.el | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/init.el b/init.el index 2644ab7..8f46823 100644 --- a/init.el +++ b/init.el @@ -396,27 +396,34 @@ ;;; Dired -(setq dired-free-space nil - dired-dwim-target t ; Propose a target for intelligent moving or copying. - dired-deletion-confirmer 'y-or-n-p - dired-filter-verbose nil - dired-recursive-deletes 'top - dired-recursive-copies 'always - dired-create-destination-dirs 'ask - image-dired-thumb-size 150) +(with-eval-after-load 'dired + (setq dired-free-space nil + dired-dwim-target t ; Propose a target for intelligent moving/copying + dired-deletion-confirmer 'y-or-n-p + dired-filter-verbose nil + dired-recursive-deletes 'top + dired-recursive-copies 'always + dired-create-destination-dirs 'ask) -(setq dired-vc-rename-file t) + ;; This is a higher-level predicate that wraps `dired-directory-changed-p' + ;; with additional logic. This `dired-buffer-stale-p' predicate handles remote + ;; files, wdired, unreadable dirs, and delegates to dired-directory-changed-p + ;; for modification checks. + (setq dired-auto-revert-buffer 'dired-buffer-stale-p) -;; Disable the prompt about killing the Dired buffer for a deleted directory. -(setq dired-clean-confirm-killing-deleted-buffers nil) + (setq dired-vc-rename-file t) -;; dired-omit-mode -(setq dired-omit-verbose nil) -(setq dired-omit-files (concat "\\`[.]\\'")) + ;; Disable the prompt about killing the Dired buffer for a deleted directory. + (setq dired-clean-confirm-killing-deleted-buffers nil) + + ;; dired-omit-mode + (setq dired-omit-verbose nil) + (setq dired-omit-files (concat "\\`[.]\\'"))) ;; ls-lisp -(setq ls-lisp-verbosity nil) -(setq ls-lisp-dirs-first t) +(with-eval-after-load 'ls-lisp + (setq ls-lisp-verbosity nil) + (setq ls-lisp-dirs-first t)) ;;; Ediff From 5b6af8044568904e8c605c5936e12c668a3d2a1b Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 27 Jun 2025 15:07:15 -0400 Subject: [PATCH 79/96] dired: Group directories first --- init.el | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/init.el b/init.el index 8f46823..05e7447 100644 --- a/init.el +++ b/init.el @@ -394,7 +394,7 @@ (setq sh-indent-after-continuation 'always) -;;; Dired +;;; Dired and ls-lisp (with-eval-after-load 'dired (setq dired-free-space nil @@ -418,18 +418,26 @@ ;; dired-omit-mode (setq dired-omit-verbose nil) - (setq dired-omit-files (concat "\\`[.]\\'"))) + (setq dired-omit-files (concat "\\`[.]\\'")) + + ;; Group directories first + (let ((args (list "--group-directories-first" "-ahlv"))) + (when (featurep :system 'bsd) + (if-let* ((gls (executable-find "gls"))) + (setq insert-directory-program gls) + (setq args (list (car args))))) + (setq dired-listing-switches (string-join args " ")))) -;; ls-lisp (with-eval-after-load 'ls-lisp (setq ls-lisp-verbosity nil) (setq ls-lisp-dirs-first t)) ;;; Ediff -;; Configure Ediff to use a single frame and split windows horizontally -(setq ediff-window-setup-function 'ediff-setup-windows-plain - ediff-split-window-function 'split-window-horizontally) +(with-eval-after-load 'ediff + ;; Configure Ediff to use a single frame and split windows horizontally + (setq ediff-window-setup-function 'ediff-setup-windows-plain + ediff-split-window-function 'split-window-horizontally)) ;;; Help From a2e5aac1406ec67ae6d53bbfaf95e22a8d24ec62 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 27 Jun 2025 15:24:24 -0400 Subject: [PATCH 80/96] dired: Group directories first --- init.el | 64 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/init.el b/init.el index 05e7447..51578e0 100644 --- a/init.el +++ b/init.el @@ -396,48 +396,46 @@ ;;; Dired and ls-lisp -(with-eval-after-load 'dired - (setq dired-free-space nil - dired-dwim-target t ; Propose a target for intelligent moving/copying - dired-deletion-confirmer 'y-or-n-p - dired-filter-verbose nil - dired-recursive-deletes 'top - dired-recursive-copies 'always - dired-create-destination-dirs 'ask) +(setq dired-free-space nil + dired-dwim-target t ; Propose a target for intelligent moving/copying + dired-deletion-confirmer 'y-or-n-p + dired-filter-verbose nil + dired-recursive-deletes 'top + dired-recursive-copies 'always + dired-create-destination-dirs 'ask) - ;; This is a higher-level predicate that wraps `dired-directory-changed-p' - ;; with additional logic. This `dired-buffer-stale-p' predicate handles remote - ;; files, wdired, unreadable dirs, and delegates to dired-directory-changed-p - ;; for modification checks. - (setq dired-auto-revert-buffer 'dired-buffer-stale-p) +;; This is a higher-level predicate that wraps `dired-directory-changed-p' +;; with additional logic. This `dired-buffer-stale-p' predicate handles remote +;; files, wdired, unreadable dirs, and delegates to dired-directory-changed-p +;; for modification checks. +(setq dired-auto-revert-buffer 'dired-buffer-stale-p) - (setq dired-vc-rename-file t) +(setq dired-vc-rename-file t) - ;; Disable the prompt about killing the Dired buffer for a deleted directory. - (setq dired-clean-confirm-killing-deleted-buffers nil) +;; Disable the prompt about killing the Dired buffer for a deleted directory. +(setq dired-clean-confirm-killing-deleted-buffers nil) - ;; dired-omit-mode - (setq dired-omit-verbose nil) - (setq dired-omit-files (concat "\\`[.]\\'")) +;; dired-omit-mode +(setq dired-omit-verbose nil) +(setq dired-omit-files (concat "\\`[.]\\'")) - ;; Group directories first - (let ((args (list "--group-directories-first" "-ahlv"))) - (when (featurep :system 'bsd) - (if-let* ((gls (executable-find "gls"))) - (setq insert-directory-program gls) - (setq args (list (car args))))) - (setq dired-listing-switches (string-join args " ")))) +;; Group directories first +(let ((args "--group-directories-first -ahlv")) + (when (featurep :system 'bsd) + (if-let* ((gls (executable-find "gls"))) + (setq insert-directory-program gls) + (setq args nil))) + (when args + (setq dired-listing-switches args))) -(with-eval-after-load 'ls-lisp - (setq ls-lisp-verbosity nil) - (setq ls-lisp-dirs-first t)) +(setq ls-lisp-verbosity nil) +(setq ls-lisp-dirs-first t) ;;; Ediff -(with-eval-after-load 'ediff - ;; Configure Ediff to use a single frame and split windows horizontally - (setq ediff-window-setup-function 'ediff-setup-windows-plain - ediff-split-window-function 'split-window-horizontally)) +;; Configure Ediff to use a single frame and split windows horizontally +(setq ediff-window-setup-function 'ediff-setup-windows-plain + ediff-split-window-function 'split-window-horizontally) ;;; Help From db5913aa4071e7df829cfa37bc53ac6fde994fec Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 28 Jun 2025 11:45:52 -0400 Subject: [PATCH 81/96] Move dired-auto-revert-buffer to README.md --- README.md | 1 + init.el | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index 8fecb86..badb7c1 100644 --- a/README.md +++ b/README.md @@ -252,6 +252,7 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already ;; on disk. (add-hook 'after-init-hook #'global-auto-revert-mode) + ;; recentf is an Emacs package that maintains a list of recently ;; accessed files, making it easier to reopen files you have worked on ;; recently. diff --git a/init.el b/init.el index 51578e0..6c958d6 100644 --- a/init.el +++ b/init.el @@ -404,12 +404,6 @@ dired-recursive-copies 'always dired-create-destination-dirs 'ask) -;; This is a higher-level predicate that wraps `dired-directory-changed-p' -;; with additional logic. This `dired-buffer-stale-p' predicate handles remote -;; files, wdired, unreadable dirs, and delegates to dired-directory-changed-p -;; for modification checks. -(setq dired-auto-revert-buffer 'dired-buffer-stale-p) - (setq dired-vc-rename-file t) ;; Disable the prompt about killing the Dired buffer for a deleted directory. From a3f2162365c17c5230e0930b08415aae2c60a6dc Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 28 Jun 2025 11:49:48 -0400 Subject: [PATCH 82/96] Add auto-revert-remote-files and dired-auto-revert-buffer --- README.md | 1 - init.el | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index badb7c1..8fecb86 100644 --- a/README.md +++ b/README.md @@ -252,7 +252,6 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already ;; on disk. (add-hook 'after-init-hook #'global-auto-revert-mode) - ;; recentf is an Emacs package that maintains a list of recently ;; accessed files, making it easier to reopen files you have worked on ;; recently. diff --git a/init.el b/init.el index 6c958d6..85624ac 100644 --- a/init.el +++ b/init.el @@ -404,6 +404,13 @@ dired-recursive-copies 'always dired-create-destination-dirs 'ask) +;; This is a higher-level predicate that wraps `dired-directory-changed-p' +;; with additional logic. This `dired-buffer-stale-p' predicate handles remote +;; files, wdired, unreadable dirs, and delegates to dired-directory-changed-p +;; for modification checks. +(defvar auto-revert-remote-files) +(setq dired-auto-revert-buffer 'dired-buffer-stale-p) + (setq dired-vc-rename-file t) ;; Disable the prompt about killing the Dired buffer for a deleted directory. From 5315bae11cb52a00379009955470f2f894eaca97 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 28 Jun 2025 11:50:18 -0400 Subject: [PATCH 83/96] Set auto-revert-remote-files to nil --- init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.el b/init.el index 85624ac..553413d 100644 --- a/init.el +++ b/init.el @@ -408,7 +408,7 @@ ;; with additional logic. This `dired-buffer-stale-p' predicate handles remote ;; files, wdired, unreadable dirs, and delegates to dired-directory-changed-p ;; for modification checks. -(defvar auto-revert-remote-files) +(setq auto-revert-remote-files nil) (setq dired-auto-revert-buffer 'dired-buffer-stale-p) (setq dired-vc-rename-file t) From dc7ff55e8cd99e84c73b7f4e74bc43fa3b6ddf67 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 29 Jun 2025 14:52:01 -0400 Subject: [PATCH 84/96] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8fecb86..0a39557 100644 --- a/README.md +++ b/README.md @@ -709,7 +709,7 @@ Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency (evil-collection-init)) ``` -You can also use the [vim-tab-bar](https://github.com/jamescherti/vim-tab-bar.el) Emacs package to `~/.emacs.d/post-init.el` to give the built-in Emacs tab-bar a style similar to Vim's tabbed browsing interface: +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: ``` emacs-lisp ;; Give Emacs tab-bar a style similar to Vim's (use-package vim-tab-bar From ee0952d0085a0c50fa3a4d419f34f808affc573e Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 29 Jun 2025 14:54:37 -0400 Subject: [PATCH 85/96] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 0a39557..1e54abd 100644 --- a/README.md +++ b/README.md @@ -718,6 +718,9 @@ You can also install the [vim-tab-bar](https://github.com/jamescherti/vim-tab-ba :hook (after-init . vim-tab-bar-mode)) ``` + +(The screenshot above showcases how vim-tab-bar modifies the built-in Emacs interface.) + The `evil-surround` package simplifies handling surrounding characters, such as parentheses, brackets, quotes, etc. It provides key bindings to easily add, change, or delete these surrounding characters in pairs. For instance, you can surround the currently selected text with double quotes in visual state using `S"` or `gS"`: ``` emacs-lisp ;; The evil-surround package simplifies handling surrounding characters, such as From ba0b6c8892dd07beef4958655b9695480050408e Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 29 Jun 2025 14:55:10 -0400 Subject: [PATCH 86/96] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1e54abd..03df74a 100644 --- a/README.md +++ b/README.md @@ -719,7 +719,8 @@ You can also install the [vim-tab-bar](https://github.com/jamescherti/vim-tab-ba ```  -(The screenshot above showcases how vim-tab-bar modifies the built-in Emacs interface.) + +*(The screenshot above showcases how vim-tab-bar modifies the built-in Emacs interface.)* The `evil-surround` package simplifies handling surrounding characters, such as parentheses, brackets, quotes, etc. It provides key bindings to easily add, change, or delete these surrounding characters in pairs. For instance, you can surround the currently selected text with double quotes in visual state using `S"` or `gS"`: ``` emacs-lisp From 241d0e37f877569dd45dd3a750bc956e023eb2fd Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 29 Jun 2025 14:55:33 -0400 Subject: [PATCH 87/96] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 03df74a..c281df2 100644 --- a/README.md +++ b/README.md @@ -720,7 +720,7 @@ You can also install the [vim-tab-bar](https://github.com/jamescherti/vim-tab-ba  -*(The screenshot above showcases how vim-tab-bar modifies the built-in Emacs interface.)* +*(The screenshot above showcases how vim-tab-bar modifies the built-in Emacs tab-bar.)* The `evil-surround` package simplifies handling surrounding characters, such as parentheses, brackets, quotes, etc. It provides key bindings to easily add, change, or delete these surrounding characters in pairs. For instance, you can surround the currently selected text with double quotes in visual state using `S"` or `gS"`: ``` emacs-lisp From 18939a1f973ca87a131f3a13a11660cba27f51ed Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 30 Jun 2025 00:14:01 -0400 Subject: [PATCH 88/96] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index c281df2..0730f61 100644 --- a/README.md +++ b/README.md @@ -1257,6 +1257,10 @@ fc-list : family | sed 's/,/\n/g' | sort -u ;; Allow Emacs to upgrade built-in packages, such as Org mode (setq package-install-upgrade-built-in t) +;; When Delete Selection mode is enabled, typed text replaces the selection +;; if the selection is active. +(delete-selection-mode 1) + ;; Display the current line and column numbers in the mode line (setq line-number-mode t) (setq column-number-mode t) From d4a4277f1266d3a14d616fe0a63783db535fdc37 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 1 Jul 2025 12:44:09 -0400 Subject: [PATCH 89/96] Update README.md --- README.md | 87 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 68 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 0730f61..667975d 100644 --- a/README.md +++ b/README.md @@ -537,21 +537,44 @@ Alternatively, `hs-minor-mode` offers basic code folding for blocks defined by c For example, to enable `outline-minor-mode` in Emacs Lisp: ``` emacs-lisp -(add-hook 'emacs-lisp-mode-hook #'outline-minor-mode) -``` - -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 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)))))) +``` + +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 " ▼ ") + (outline-indent-ellipsis " ▼") :init ;; The minor mode can also be automatically activated for a certain modes. @@ -562,9 +585,7 @@ For folding based on indentation levels, the **[outline-indent](https://github.c (add-hook 'yaml-ts-mode-hook #'outline-indent-minor-mode)) ``` -In addition to code folding, *outline-indent* also 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 more. - - + ### Changing the default theme @@ -683,12 +704,6 @@ To install and configure these packages, add the following to `~/.emacs.d/post-i 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): ``` emacs-lisp -;; Required by evil-collection -(eval-when-compile - ;; It has to be defined before evil - (setq evil-want-integration t) - (setq evil-want-keybinding nil)) - ;; Uncomment the following if you are using undo-fu ;; (setq evil-undo-system 'undo-fu) @@ -696,15 +711,49 @@ Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency (use-package evil :ensure t :commands (evil-mode evil-define-key) - :hook (after-init . evil-mode)) + :hook (after-init . evil-mode) -(eval-when-compile - ;; It has to be defined before evil-colllection - (setq evil-collection-setup-minibuffer t)) + :init + ;; It has to be defined before evil + (setq evil-want-integration t) + (setq evil-want-keybinding nil) + + :custom + ;; Make :s in visual mode operate only on the actual visual selection + ;; (character or block), instead of the full lines covered by the selection + (evil-ex-visual-char-range t) + ;; Use Vim-style regular expressions in search and substitute commands, + ;; allowing features like \v (very magic), \zs, and \ze for precise matches + (evil-ex-search-vim-style-regexp t) + ;; Enable automatic horizontal split below + (evil-split-window-below t) + ;; Enable automatic vertical split to the right + (evil-vsplit-window-right t) + ;; Disable echoing Evil state to avoid replacing eldoc + (evil-echo-state nil) + ;; Do not move cursor back when exiting insert state + (evil-move-cursor-back nil) + ;; Make `v$` exclude the final newline + (evil-v$-excludes-newline t) + ;; Allow C-h to delete in insert state + (evil-want-C-h-delete t) + ;; Enable C-u to delete back to indentation in insert state + (evil-want-C-u-delete t) + ;; Enable fine-grained undo behavior + (evil-want-fine-undo t) + ;; Allow moving cursor beyond end-of-line in visual block mode + (evil-move-beyond-eol t) + ;; Disable wrapping of search around buffer + (evil-search-wrap nil) + ;; Whether Y yanks to the end of the line + (evil-want-Y-yank-to-eol t)) (use-package evil-collection :after evil :ensure t + :init + ;; It has to be defined before evil-colllection + (setq evil-collection-setup-minibuffer t) :config (evil-collection-init)) ``` From 42929fd0804c85eb7cd1f74c7047a84223984d11 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Thu, 3 Jul 2025 12:09:53 -0400 Subject: [PATCH 90/96] Enable list-threads --- init.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 553413d..70a2f27 100644 --- a/init.el +++ b/init.el @@ -551,7 +551,8 @@ ;;; Remove warnings from narrow-to-region, upcase-region... (dolist (cmd '(list-timers narrow-to-region upcase-region downcase-region - erase-buffer scroll-left dired-find-alternate-file)) + list-threads erase-buffer scroll-left + dired-find-alternate-file)) (put cmd 'disabled nil)) ;;; Load post init From 081acac52c9d50a6fa5ac92c8792cdb8a3687163 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 4 Jul 2025 22:19:25 -0400 Subject: [PATCH 91/96] Fixes #67: Dired doesn't work in MacOS because of --group-directories-first --- init.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 70a2f27..7642ad7 100644 --- a/init.el +++ b/init.el @@ -422,7 +422,8 @@ ;; Group directories first (let ((args "--group-directories-first -ahlv")) - (when (featurep :system 'bsd) + (when (or (eq system-type 'darwin) + (eq system-type 'berkeley-unix)) (if-let* ((gls (executable-find "gls"))) (setq insert-directory-program gls) (setq args nil))) From 2e5a413d72211de4073f131d2cea5fa854d55ed6 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 4 Jul 2025 11:44:46 -0400 Subject: [PATCH 92/96] Update README.md --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index 667975d..b33038a 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,6 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's - [How to load a local lisp file for machine-specific configurations?](#how-to-load-a-local-lisp-file-for-machine-specific-configurations) - [How to load Emacs customizations?](#how-to-load-emacs-customizations) - [How to increase gc-cons-threshold?](#how-to-increase-gc-cons-threshold) - - [How to change the outline-mode or outline-minor-mode Ellipsis (...) to (▼)?](#how-to-change-the-outline-mode-or-outline-minor-mode-ellipsis--to-) - [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) @@ -1613,10 +1612,6 @@ Add the following to `~/.emacs.d/pre-early-init.el` to ensure that *minimal-emac (setq minimal-emacs-gc-cons-threshold (* 64 1024 1024)) ``` -### How to change the outline-mode or outline-minor-mode Ellipsis (...) to (▼)? - -If you want to to change the outline-mode or outline-minor-mode Ellipsis (...) to (▼), use the code snippet in this article: [Changing the Ellipsis (“…”) in outline-mode and outline-minor-mode](https://www.jamescherti.com/emacs-customize-ellipsis-outline-minor-mode/). - ### How to prevent Emacs from loading .dir-locals.el files? By default, Emacs loads `.dir-locals.el` from the current directory or its parents and applies project-specific settings such as indentation, compilation commands, or custom minor modes. While useful in many cases, this behavior can introduce unintended overrides, inconsistencies, or even security risks when working with untrusted projects. From 9e7911fab1f90f28d0f5d363aadf20b6a8b3e93a Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 4 Jul 2025 23:23:20 -0400 Subject: [PATCH 93/96] Update README.md --- README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b33038a..bca1077 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,11 @@ The **minimal-emacs.d** project is a lightweight and optimized Emacs base (`init 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. - -- `init.el`: Loaded after the graphical interface is initialized. This file contains user customizations, including variable settings, package loading, mode configurations, and keybindings. +**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. @@ -23,7 +23,9 @@ The *minimal-emacs.d* project is: - **0 packages loaded / No forced modes:** Unlike other frameworks or starter kits, *minimal-emacs.d* does not impose modes or require packages. **You have full control** over which global or minor modes to enable and which packages to load with `require`. - **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)) -**Here are the instructions for installing minimal-emacs.d:** [Install minimal-emacs.d](#install-minimal-emacsd). +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.  *(The theme shown in the screenshot above is ef-melissa-light, which is part of the ef-themes collection available on MELPA.)* @@ -1319,6 +1321,9 @@ fc-list : family | sed 's/,/\n/g' | sort -u (dolist (hook '(prog-mode-hook text-mode-hook conf-mode-hook)) (add-hook hook #'display-line-numbers-mode)) +;; Set the maximum level of syntax highlighting for Tree-sitter modes +(setq treesit-font-lock-level 4) + (use-package which-key :ensure nil ; builtin :commands which-key-mode From afffa5bade64e6fb44ca970d0230423e60551ef6 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 4 Jul 2025 23:58:01 -0400 Subject: [PATCH 94/96] Add redisplay-skip-fontification-on-input --- README.md | 5 ----- init.el | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bca1077..1c4989b 100644 --- a/README.md +++ b/README.md @@ -1400,11 +1400,6 @@ fc-list : family | sed 's/,/\n/g' | sort -u (setq vc-make-backup-files t) (setq kept-old-versions 10) (setq kept-new-versions 10) - -;; Improve Emacs responsiveness by deferring fontification during input -;; -;; NOTE: This may cause delayed syntax highlighting in certain cases -(setq redisplay-skip-fontification-on-input t) ``` It is also recommended to read the following articles: diff --git a/init.el b/init.el index 7642ad7..ad18a40 100644 --- a/init.el +++ b/init.el @@ -261,6 +261,12 @@ 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 From c9cd53c40891a6562395c77d860c15a03095d88d Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 5 Jul 2025 14:31:28 -0400 Subject: [PATCH 95/96] Add option: minimal-emacs-dired-group-directories-first --- early-init.el | 3 +++ init.el | 18 ++++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/early-init.el b/early-init.el index a07624b..08badb6 100644 --- a/early-init.el +++ b/early-init.el @@ -96,6 +96,9 @@ modified during setup.") (defvar minimal-emacs-user-directory user-emacs-directory "The default value of the `user-emacs-directory' variable.") +(defvar minimal-emacs-dired-group-directories-first t + "If non-nil, group directories first in Dired listings.") + ;;; Load pre-early-init.el ;; Prefer loading newer compiled files diff --git a/init.el b/init.el index ad18a40..7500c5b 100644 --- a/init.el +++ b/init.el @@ -427,14 +427,16 @@ (setq dired-omit-files (concat "\\`[.]\\'")) ;; Group directories first -(let ((args "--group-directories-first -ahlv")) - (when (or (eq system-type 'darwin) - (eq system-type 'berkeley-unix)) - (if-let* ((gls (executable-find "gls"))) - (setq insert-directory-program gls) - (setq args nil))) - (when args - (setq dired-listing-switches args))) +(when minimal-emacs-dired-group-directories-first + (with-eval-after-load 'dired + (let ((args "--group-directories-first -ahlv")) + (when (or (eq system-type 'darwin) + (eq system-type 'berkeley-unix)) + (if-let* ((gls (executable-find "gls"))) + (setq insert-directory-program gls) + (setq args nil))) + (when args + (setq dired-listing-switches args))))) (setq ls-lisp-verbosity nil) (setq ls-lisp-dirs-first t) From e212588d840b6311688b205b656291af43841ad6 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 5 Jul 2025 22:02:54 -0400 Subject: [PATCH 96/96] Change minimal-emacs-dired-group-directories-first to nil --- early-init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/early-init.el b/early-init.el index 08badb6..867bf29 100644 --- a/early-init.el +++ b/early-init.el @@ -96,7 +96,7 @@ modified during setup.") (defvar minimal-emacs-user-directory user-emacs-directory "The default value of the `user-emacs-directory' variable.") -(defvar minimal-emacs-dired-group-directories-first t +(defvar minimal-emacs-dired-group-directories-first nil "If non-nil, group directories first in Dired listings.") ;;; Load pre-early-init.el+