Welcome to
Mastering Emacs
mastering the world’s best text editor

Emacs 29 Edition is out now!


What is new on Mastering Emacs?

Combobulate: Bulk Editing Tree-Sitter Nodes with Multiple Cursors

Combobulate's long had the ability to bulk edit matches using the multiple cursors package, but building seamless and useful bulk editing tooling is not as straightforward as it seems. And what if you don't use multiple cursors? Combobulate now has its own field editor to help you bulk edit.

Try Mastering Emacs for free!

Are you struggling with the basics? Have you mastered movement and editing yet? When you have read Mastering Emacs you will understand Emacs.

Earlier on Mastering Emacs

The Emacs 29 Edition of Mastering Emacs is out now

The Emacs 29 edition of Mastering Emacs is now available.

Combobulate: Interactive Node Editing with Tree-Sitter

Editing code using a concrete syntax tree may seem straightforward, but it's a complex task fraught with challenges. For every command that modifies the code, there's ample room for ambiguity. What if there are multiple legal choices available? How do you create a user experience in Emacs that not only displays the intended changes but also caters to the needs of power users seamlessly? Here I talk about how I've solved that problem in Combobulate.

Combobulate: Intuitive, Structured Navigation with Tree-Sitter

Tree-sitter's promise of simplifying code navigation can seem like a dream, but in reality, it introduces its own set of challenges that complicate the process. In this article, I delve into the intricate nature of crafting intuitive navigation within a tree-sitter environment, shedding light on the complexities that can confound our expectations of how code exploration should flow seamlessly.

Let's Write a Tree-Sitter Major Mode

Creating a standard programming major mode presents significant challenges, with the intricate tasks of establishing proper indentation and font highlighting being among the two hardest things to get right. It's painstaking work, and it'll quickly descend into a brawl between the font lock engine and your desire for correctness.

Tree-sitter makes writing many major modes a snap: here I demonstrate how to write a working indentation and font lock engine for HTML.
Explore more articles

New to Mastering Emacs?

Are you exploring Emacs for the first time, or yearning to take your skills to new heights? Here’s a select collection of articles to guide you on your journey:

Running Shells in Emacs: An Overview If you want to know more about using Emacs as a terminal emulator or to run Shells, this is a great place to start. I cover Shell Mode, a wrapper around shells such as bash; EShell, a fantastic shell written entirely in elisp; Term, a builtin terminal emulator; and VTerm, a blazing fast terminal emulator package.

Combobulate: Structured Movement and Editing with Tree-Sitter Combobulate is my package that adds advanced structured editing and movement to a slew of programming modes. It’ll supercharge your development experience. Give it a shot.

Evaluating Elisp in Emacs Evaluating elisp is a necessary skill you must learn once you reach a certain point in your Emacs career. I explain all the ways you can do it.

Understanding Minibuffer Completion The minibuffer drives most of your interactions with Emacs, so you should spend the time to learn how it really works. Emacs has had a lot of development over the years to improve the quality and user experience of the minibuffer completion system.

Complete Guide to Mastering EShell If the idea of using an all-Emacs shell is alluring then you must read my article on mastering EShell. It tightly integrates with Emacs and has a wealth of interesting features.

Mastering Keybindings Binding keys in Emacs is not easy if you haven’t done it before, but in this article I will walk you through all the many ways of doing it: how to bind keys to particular modes and globally and a selection of templates you can use for your own init file.

Keyboard Macros are Misunderstood Few people really use keyboard macros. They’re consigned to boring, repetitive text editing — but you can do so much more: set up your favorite window layout; bulk edit across files; and much more. In fact, they should be your first port of call for basic Emacs automation tasks if you’re not that handy at elisp yet.

My book If you’re struggling with Emacs, then give my book a try. I’ll teach you Emacs in 314 breezy, easy-to-read pages.

The Mastering Emacs Reading Guide My reading guide will help you get the most from my blog and the most from Emacs.

Copyright 2010-24 Mickey Petersen. Terms & Privacy Policy (Last updated 2022-05-24.)