Improving my Emacs configuration is an open-ended hobby. Recently I discovered a couple of things that I’ve incorporated into my daily usage that I’ve found really useful and thought I’d document and share them here.
vundo
Emacs has a complicated undo history and I often find myself going round in circles. Enter vundo which is a really neat little package that makes navigating the undo history much easier by providing a graphical overview of the sometimes branching undo history. By default it comes with the key-binding C-c v
which will popup a buffer at the bottom showing a graph of your undo history. Switch to this buffer and you can use keys to navigate to older points in the undo history. If you want to know what differs just hit d
. If you enable vundo-popup-mode
then the buffer will appear whenever you hit the traditional C-x u
to undo some changes. I have this set as a hook for a couple of modes.
use-package vundo
(t
:ensure
:hook
(prog-mode . vundo-popup-mode) (text-mode . vundo-popup-mode))
Regex Builder
I’m not great at writing Regular Expressions (aka regex) and regularly resort to online builders (e.g. regexr or regex101) but these a) lack Emacs’ flavour of regex’s; b) don’t contain what is in the buffer I’m editing and want to search/replace.
Enter re-builder
which when invoked brings up a buffer into which you can start typing your regular expression and matches in the buffer you are editing are highlighted. Pretty handy for finding things at least, but what about replacing regex matches, which is my typical recourse for using a regex?
Well as with most things, someone else has already thought about this and I found this excellent post on Bridging Islands in Emacs by Karthink. I won’t repeat the contents here and recommend you read the article and absorb it into your configuration. You can see mine here.
Now when I use C-M-%
which is the default for query-replace-rexp
it instead calls re-builder
and I can start writing my regular expression and see matches. Once I’ve got the regex correct simply hit Ret
and I’m prompted to enter what I want to replace matches with.
One thing I’ve not quite sussed out yet is the different input methods of regex’s this takes, it seems more backslashes are required in one method than “standard” but re-builder
translates things back to the standard notation on saving.
Tony Aldon has made a good video that shows how to use re-builder
.
Yank from kill ring
Copying (yanking) and pasting (insert) is a common task in Emacs and a history of what you have copied is kept in the “kill-ring”. You can insert older items if you know their position in this history by preceding C-y
with C-#
(where #
) represents the Nth most recent yank. But what if you can’t remember how many yanks back the item you want to insert is?
Obviously Emacs has your back as you can use M-y
which pops up a buffer containing the kill-ring history which you can easily move through and hit Ret
to insert the item you want. Simple but a game changer that I now use on a daily basis.
use-package
use-package is a commonly used package that helps simplify installing and configuring packages. I have the following snippet early in my init.el
to ensure it is installed and can be used subsequently to load and configure all packages.
;; https://ianyepan.github.io/posts/setting-up-use-package/
unless (package-installed-p 'use-package)
(
(package-refresh-contents)'use-package)) (package-install
I noticed recently that the GitHub repo was archived in 2025-08-23 and the notice in the README.md
indicates that it is now a core Emacs package meaning I can simply configure the package with the following instead (configuration details are already in the official documentation).
use-package use-package
(
:configsetq use-package-always-ensure t)
(setq use-package-expand-minimally t)) (
Emacs pre-commit
I’m a big fan of pre-commit (see previous posts) and already use the lisp-format hook on my configuration files. Recently I clocked there was a new linter in the form of pre-commit-elisp which I’ve added to the hooks I use on my configuration repository. Configuration is simple by adding the following to .pre-commit-config.yaml
.
- repo: https://github.com/jamescherti/pre-commit-elisp
rev: v1.0.0
hooks:
# Validate that all parentheses in .el files are correctly balanced
- id: elisp-check-parens
# Byte-compile .el files to identify compilation errors early
# - id: elisp-byte-compile
# Optional:
# NOTE: This change the indentation.
- id: elisp-indent
As you can see I opted not to byte-compile all files by commenting that line out.
Summary
Emacs is a 🐰 🕳️ but that is part of the fun and I always enjoy discovering new features and packages that make my life that little bit easier. Now all I need to do is go through and re-write my Emacs configuration as a literate org-mode and make sure I’m Using use-package the right way.
Reuse
Citation
@online{shephard2025,
author = {Shephard, Neil},
title = {Emacs {Tips} \& {Tweaks} (2025-09-05)- Vundo, Regex Builder
and More},
date = {2025-09-05},
url = {https://blog.nshephard.dev/posts/emacs_202509/},
langid = {en}
}