The Mastering Emacs ebook cover art

Emacs 27 Edition is out now!

$39.99 Buy Now

Learn More

Reading Guide

Welcome to my Mastering Emacs reading guide. Here’s a selection of articles that cover a variety of topics that will make you better at Emacs.

I recommend you read one article and try to absorb as much of the material as you can; don’t try to cram it – pick it up naturally. Ask yourself, if you’re trying to do something out of the “ordinary” if you can do it in a cleverer way by either consulting my site or using Google.

I’m New to Emacs

If you’re a complete beginner to Emacs, then you should start out by first reading the built-in tutorial (type C-h t) and then read my Beginner’s Guide to Emacs. In the article I explain some common Emacs terminology and how to accomplish the most common tasks that a new user would want to do:

  • How do you customize Emacs?
  • How can I make cut/copy/paste work like other editors?
  • How do I load Emacs packages I found on the Internet?
  • Why you shouldn’t use the terminal to edit your code (unless you must)

… and much more.

Next on the list is my very detailed guide to effective editing and movement in Emacs. In it, I explain all but the most esoteric “movement” commands available, out-of-the-box, in Emacs. I highly, highly recommend you read this next; if you’re going to go to the effort to learn Emacs, you may as well learn to use it like a pro.

Once you’re familiar with the material in the two guides above, you’re free to read any of my articles; almost all of them assume no knowledge about the subject matter at all, and they invariably include a gentle introduction to the concepts required to understand the subject matter.

Nevertheless, I do have some articles that’re written with beginners (and experts!) in mind:

In my Beginner’s Guide to Emacs article I briefly mention IDO Mode. IDO Mode is a replacement for the buffer switching and find file functionality in Emacs; it gives it fuzzy matching and “match-as-you-type” functionality – probably one of the most important and useful features in Emacs when you consider how often you find files and switch buffers! My article on IDO mode will tell you all you need to know to get started with IDO Mode.

Customization is the corner stone of Emacs. No other editor – no other editor – has the flexibility and extensibility offered by Emacs. Once you’re comfortable using the M-x customize GUI in Emacs you’re probably itching to customize Emacs’s keybindings – the one thing you cannot easily do, and persist to your .emacs file, without getting your hands dirty. My article on mastering key bindings in Emacs explains, well, everything you’d care to know about binding keys in Emacs. I also include handy templates for the most frequent key binding tasks you’ll encounter, so it’s easy to snarf the example code and modify it to suit your needs.

Emacs’s built-in Info system is the same as the one that powers Linux’s info manuals, but with one key difference: the Emacs Info browser is miles ahead of the old, crusty commandline viewer. If you’re not sure where to find something, you can use apropos with info to full text search all the Info documents.

I want to Customize Emacs

Emacs has a wealth of built-in customization toggles, dials and switches; but unfortunately not everything is configurable through a UI. Here’s a handful of articles where I talk about changing some aspect of Emacs to make it better, more productive or easier to use.

The first thing to read is probably my article on disabling prompts in Emacs. The prompts are useful, yes; and they serve a purpose, yes; but they have a habit of driving you insane after a while.

The next simple change is to make tooltips appear in the echo area. Very useful if you’re a keyboard person and don’t use a mouse. Along a similar vein, you can make Emacs start up maximized so as to save you the hassle of maximizing Emacs manually.

If you’re using a Window system you can force Emacs to move deleted files to the trash can, and possibly improve Emacs’s display engine performance.

Improving Productivity

These articles set out to improve productivity in some way. This may involve changing key bindings, copying some elisp code or explaining an underused feature.

The first of the lot is how to find files faster by remembering recently used files and hotwiring it so it uses IDO mode to display the files.

Next on the list is finding stuff faster using occur, a very handy feature that searches an open buffer for a regexp of your choosing. I also show how to extend occur to make it more useful for searching multiple buffers at once.

Another massive productivity booster is learning how to execute shell commands in Emacs and how to pipe input from a buffer and output from the command in and out of Emacs. Amazingly useful – especially if you’re good at commandline-fu and want to apply your one-liners to Emacs buffers.

Once you’re comfortable invoking commands in Emacs, why not use Emacs’s own terminal emulators or some of its shell support? My article on running shells in Emacs will put you on the right path.

Doing the same thing over and over again is normally a job for a macro; but what if you just want to repeat the last command?

The dired functionality in Emacs is great, but it only works on one directory at a time. So what if you want to work on multiple files spread out over many directories? Why, you use dired’s find file functionality.

Working with Text

This is where Emacs starts to shine. Manipulating text. Other users of inferior editors invariably reach for a scripting language or a commandline tool to perform all but the most banal text manipulation tasks.

First up is sorting text in Emacs. But actually, Emacs can do more than just sort by line. Check it out. Useful knowledge to have.

If you’re a fan of regular expressions, you should be using re-builder, Emacs’s regular expression builder. Even if you’re a skilled regex guy, it will come in handy occasionally.

Converting between tabs and spaces is a useful thing to know, regardless of whether you’re in this camp or that camp.

If you’re frequently reaching for a Unicode table to insert diacritic marks, look no further; Emacs’s input method engine will let you switch from the most likely and unlikely input sources to facilitate key input.

Workflow Articles

These articles cover very specific tasks in great detail, and they use a variety of commands and concepts, including elisp code where necessary. If you’re looking for examples of how to apply all your new-found knowledge in new and interesting ways, these articles can help.

If you’re a python man and you work with Python and the Python inferior shell a lot, my article on writing code to toggle between python and the shell may be of interest. Even if you don’t do Python you could adapt the code to other environments, such as Ruby.

I’ve gotten hooked on the Vimgolf craze and I am solving the Vimgolf puzzles using Emacs instead of vim, of course!

Here’s a very common problem people encounter: how do you trim blank or whitespaced lines?

Advanced Topics

All the way at the bottom is my section on “advanced” topics. They’re not actually advanced but they’re probably of less interest to all but the more serious Emacs users out there.

First up is how to master the mysterious and, sadly, under-documented shell replacement, eshell, a shell written entirely in Elisp.

If you regularly use the mark commands to jump around your buffers, you’ll know that it doesn’t gel that well with transient mark mode. My article on fixing the mark commands tries to right that wrong.

And last, but absolutely not least, a very detailed look at evaluating elisp code in Emacs. If you’re serious about learning elisp you must know how to evaluate and test your code.