![stripspace.el - Make Emacs auto remove trailing whitespace before saving a buffer, with a options to preserve the cursor column, normalize indentation, and restrict whitespace cleanup to clean buffers [Release 1.0.6]](https://external-preview.redd.it/wDHJo_IFWyOe_T4doTGuu2pLPH9s-TcG5pJjbcPMyQM.png?width=1080&crop=smart&auto=webp&s=a3b4037b19cb117e843ae2ee3737ede8f67b77e5)
![stripspace.el - Make Emacs auto remove trailing whitespace before saving a buffer, with a options to preserve the cursor column, normalize indentation, and restrict whitespace cleanup to clean buffers [Release 1.0.6]](https://external-preview.redd.it/wDHJo_IFWyOe_T4doTGuu2pLPH9s-TcG5pJjbcPMyQM.png?width=1080&crop=smart&auto=webp&s=a3b4037b19cb117e843ae2ee3737ede8f67b77e5)
Vim Resources - Guides, documentation, tutorials, forums...
jamescherti.comWhy blogs and news sites should block AI training crawlers (and how to do it)
For blogs, news sites, and independent publishers, web traffic to their original content is the primary metric for success. Allowing AI companies to steal your original content without authorization for model training consumes server resources and bandwidth, while providing near-zero referral traffic in return. For example, Anthropic scrape 38,065 pages for every single visitor they refer back (See the statistics below).
However, blocking ALL AI bots can unintentionally break your visibility in AI search features that provide citations and referral links. To prevent this, you should configure access rules based on bot purpose, since AI companies operate separate crawlers for model training, search indexing, and on-demand user retrieval.
Read: Why blogs and news sites should block AI training crawlers (and how to do it)
The Root Causes of Scrolling Lag in Emacs display-line-numbers-mode
The display-line-numbers-mode and global-display-line-numbers-mode modes render line numbers in the margin of an Emacs window. Line-number display is implemented in the core C display engine, avoiding the overhead of legacy Elisp overlays like linum-mode.
Despite the native C implementation, specific configurations can still trigger expensive Lisp evaluations during the interactive command loop, vertical scrolling, and buffer initialization.
Why Emacs Consult async searches feel slow and how to speed them up? (consult-fd, consult-find, consult-grep, consult-ripgrep...)
Consult provides asynchronous search commands such as consult-fd, consult-find, consult-grep, consult-git-grep, and consult-ripgrep. For these commands, Consult does not necessarily start a new search for every change to the minibuffer input. Instead, it uses configurable debounce and throttle delays to control when asynchronous processes start, while a separate refresh delay controls how frequently asynchronous results are pushed to the completion UI.
The first time I tried the consult Emacs package, I said to myself: this feels slow compared to Counsel. With Counsel, results updated immediately on every keystroke, while Consult seemed to hesitate for a fraction of a second before fetching the list.
As it turns out, this behavior is entirely intentional. The current Consult defaults are conservative by design.
Guide to Deferred Package Loading with use-package (Optimizing Emacs Startup)
As an Emacs user, your configuration can easily grow from a few lightweight adjustments to a massive, hundred-package IDE. Without careful management, Emacs startup time can degrade from sub-second execution to several seconds, or minutes, in the worst cases. Eager package loading is one common source of startup overhead. This guide explains how Emacs loads libraries, how use-package configures package loading, and how deferred loading can reduce startup time.
Read more: Guide to Deferred Package Loading with use-package (Optimizing Emacs Startup)
The Emacs Security Settings that might Silently Compromise your System
Emacs ships with default settings intended for backward compatibility and convenience over strict security. The following settings enforce TLS certificate verification, reduce unintended network lookups, restrict the evaluation of potentially unsafe local file, and directory variables, automated package review system, and protect authentication credentials stored by Emacs.
Read more: The Emacs Security Settings that might Silently Compromise your System
Securing and reducing prompts for Emacs .dir-locals.el and local variables
Emacs automatically applies project-specific configurations through file-local and directory-local (.dir-locals.el) variables when opening a file. This feature can cause security risks and persistent prompt fatigue when editing source code. Malicious .dir-locals.el files or file-local variables containing eval forms can execute arbitrary Lisp code if Emacs is configured to evaluate them, or if the user approves the relevant prompt by mistake. This article outlines configurations for securing file-local and directory-local variables while reducing prompts.
Read more: Securing and reducing prompts for Emacs .dir-locals.el and local variables
Practical Emacs Dired Tweaks
This article presents a set of Emacs Dired configuration changes to enhance file management. The configurations sort directories before files for easier navigation, hide dotfiles, reduce unnecessary confirmation prompts, prevent UI lockups caused by network latency, among other improvements. Each configuration explains the behavior of the relevant setting, its benefits, and its tradeoffs, making it easier to determine which changes are appropriate.
Read more: Practical Emacs Dired Tweaks
Measuring Emacs Startup Time More Accurately Than the Built-in emacs-init-time Function
As an Emacs configuration grows, startup time can gradually increase. Measuring that increase accurately makes it easier to identify regressions. However, the built-in emacs-init-time function does not measure the entire startup sequence.
This article provides a code snippet that accurately measures your total Emacs startup time:
Measuring Emacs Startup Time More Accurately Than the built-in emacs-init-time
Configuring Python Development in Emacs: Eglot, Pylsp, and Dynamic Ruff Integration
Setting up a Python development environment in Emacs has become much more straightforward thanks to Eglot, the built-in Language Server Protocol (LSP) client. When paired with python-lsp-server (pylsp), developers gain access to a backend that supports autocompletion, linting, formatting, and refactoring. This article demonstrates how to configure Eglot to use Ruff dynamically when it is available on your system, while gracefully falling back to tools like Flake8, pycodestyle, and pydocstyle when it is not.
Read more: Configuring Python Development in Emacs: Eglot, Pylsp, and Dynamic Ruff Integration
Configuring Emacs Scrolling for Better Performance and Usability
By default, scrolling in Emacs often recenters the screen abruptly when the cursor hits the edge of a window, and rapid scrolling through large, heavily syntax-highlighted files can introduce noticeable input lag. Fortunately, the display engine exposes numerous variables that allow you to configure how the buffer should behave when navigating vertically and horizontally.
This article outlines configurations that make scrolling more predictable and responsive:
- Predictable recentering
- Smooth panning
- Input latency fixes
- Workflow improvements
- Modern trackpad support
Full breakdown and annotated configuration snippet:
Configuring Emacs Scrolling for Better Performance and Usability
Configuring Emacs Eglot for Optimal Performance
jamescherti.comEmacs: Copy-paste without org-mode formatting bleeding into other buffers
jamescherti.comEmacs: Configuring Flyspell, Ispell, and Aspell to Minimize False Positives in Source Code and Prose
jamescherti.comEmacs startup: Why setq beats setopt, customize-set-variable, and use-package :custom
jamescherti.comminimal-emacs.d - A Customizable Emacs init.el and early-init.el for Better Defaults and Optimized Startup [Release 1.5.1]
Version 1.5.1 has been released.
The minimal-emacs.d project is a fast and lightweight minimal Emacs starter kit (init.el and early-init.el) that gives you full control over your configuration. It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup. Each setting in minimal-emacs.d is carefully chosen to answer this question: does it provide a better default that modernizes Emacs while keeping it lightweight, fast and stable?
jc-gentoo-portage - An opinionated, performance-oriented Gentoo Portage /etc/portage configuration
The jc-gentoo-portage repository hosts an opinionated, performance-oriented Gentoo Portage (/etc/portage) configuration.
It can be used as an inspiration to build a lean and fast Gentoo Linux operating system.