Let me guess. You’ve just opened Emacs for the first time, and you’re staring at a screen that looks like it hasn’t changed since 1985. There’s probably a cartoon gnu staring back at you. You tried to quit, but Esc didn’t work. Neither did Ctrl+Q. You might have even tried typing “exit” or “quit” in desperation.
Welcome to Emacs! Where the learning curve is a cliff, but the view from the top is spectacular.
Let’s make sure you have a decent version of Emacs installed. You want Emacs 27 or later—anything older and you’re just punishing yourself unnecessarily.
brew install emacs
Or if you want the GUI version with native compilation (faster, shinier):
brew tap d12frosted/emacs-plus
brew install emacs-plus@30 --with-native-comp
# Debian/Ubuntu
sudo apt-get install emacs
# Fedora
sudo dnf install emacs
# Arch (because of course you use Arch)
sudo pacman -S emacs
Download from gnu.org, or better yet, use WSL2 and install the Linux version. Trust me on this one.
🚸 IDE Refugee Note: Yes, the installation is this simple. No, there’s no 2GB download. No, you don’t need to sign in with an account. Emacs predates the concept of “activation keys” by about 20 years.
Before we go any further, we need to talk about notation. Emacs documentation uses:
C- means “hold Control”M- means “hold Meta” (which is probably Alt on your keyboard, or Cmd on Mac)So when you see C-x C-s, that means:
When you see C-x s, that means:
🤔 Why Though? The “Meta” key comes from ancient Lisp machines that had actual Meta keys. Your keyboard doesn’t have one, so we use Alt. Or Escape. Yes, pressing Escape and then the key also works. No, I don’t know anyone who does it that way. Yes, it’s there if you’re using Emacs on your phone for some reason.
Ready? Here’s how to open a file:
C-x C-f
This runs find-file. You’ll see a prompt at the bottom of the screen (that’s called the minibuffer, by the way). Type a filename and press Enter.
🎯 Pro Tip: You can use Tab for autocompletion in the minibuffer. It’s not as fancy as your IDE’s fuzzy finder (yet), but it works.
You can use arrow keys. It’s fine. We won’t judge you. (We’re totally judging you, but you’ll learn the proper keys soon enough.)
For now, just know:
Backspace deletes backwardC-d deletes forward (or just use Delete)C-k kills (cuts) from cursor to end of line🚸 IDE Refugee Note: There’s no “insert mode” vs “command mode” like in Vim. You’re always in insert mode. Commands are done with key combinations. This will feel weird for exactly three days, then it’ll feel natural.
C-x C-s
That’s it. File saved. You’ll see a message in the minibuffer confirming it.
Want to “Save As” with a different name?
C-x C-w
(The ‘w’ stands for “write”, because of course it does.)
C-/ or C-_ or C-x u all undo. Why three ways? Because different keyboards make different keys hard to reach, and Emacs has been around long enough to have opinions about all of them.
But here’s where it gets interesting: Emacs has infinite undo. And I mean infinite. You can undo back to when you opened the file. Then—and this is the mind-bending part—you can undo your undos.
🤔 Why Though? In Emacs, undo is just another action that can be undone. If you undo too far, just break the undo chain (by moving the cursor or typing something) and then undo again—you’ll start undoing your undos. It’s undo all the way down.
To quit Emacs:
C-x C-c
If you have unsaved changes, it’ll ask if you want to save them.
To cancel a command that’s in progress:
C-g
This is your escape hatch. Memorize it. When Emacs is doing something weird and you don’t know why, C-g is your friend.
Here’s where things get interesting. Open a second file:
C-x C-f another-file.txt
Now you have two files open. Switch between them with:
C-x b
This runs switch-to-buffer. You’ll see a list of open buffers (files). Type part of the name and hit Tab to autocomplete.
🎮 Try This:
C-x bC-x sEmacs has the most comprehensive built-in help system of any software I’ve ever used. And it needs it.
C-h t - The tutorial (seriously, do this)C-h k - Describe what a key combination doesC-h f - Describe what a function doesC-h v - Describe what a variable doesC-h ? - Help about help (it’s turtles all the way down)🎯 Pro Tip: Accidentally hit a key combination and something weird happened? Hit C-h l (that’s lowercase L) to see the last 300 keystrokes you typed. It’s like a flight recorder for your editing session.
Add this to your ~/.emacs or ~/.emacs.d/init.el file (create it if it doesn’t exist):
;; Make Emacs less ugly
(menu-bar-mode -1) ; Disable the menu bar
(tool-bar-mode -1) ; Disable the tool bar
(scroll-bar-mode -1) ; Disable the scroll bar
(global-display-line-numbers-mode 1) ; Show line numbers
;; Make it less beepy
(setq ring-bell-function 'ignore)
;; Show matching parentheses
(show-paren-mode 1)
;; Enable mouse support in terminal
(xterm-mouse-mode 1)
;; Make the cursor a bar instead of a block
(setq-default cursor-type 'bar)
Restart Emacs (C-x C-c to quit, then open it again), and it’ll look slightly more modern. We’ll do much more customization later, but this gets you started.
Let’s put it all together. Here’s a simple workflow:
emacsC-x C-f myfile.txtC-x C-sC-x C-f another.txtC-x b myf<Tab><Enter>C-x sC-x C-cCongratulations! You’re now more productive in Emacs than 50% of people who try it and give up immediately.
In the next chapter, we’ll explore why Emacs thinks about text differently than every other editor you’ve used. We’ll talk about buffers, windows, and frames, and why understanding these concepts will make everything else click.
But for now, practice these basics. Open some files. Edit them. Save them. Get comfortable with C-g when things go wrong.
And remember: every Emacs user was once where you are now, staring at this bizarre program and wondering why anyone would subject themselves to this. The answer, as you’ll discover, is that Emacs isn’t just a text editor—it’s a text editing environment. And once you start shaping that environment to your will, you’ll understand why some of us never leave.
🎮 Chapter 1 Exercises:
C-h k to find out what C-x C-b does, then try itC-h t) for 15 minutes—it’s actually good!“Emacs is the only software that I’ve used for 30 years and am still discovering new features.” —Anonymous Emacs User (could be any of us, really)