11. Emacs Buffer Navigation

Lesson Content

To move around buffers (or files you’re visiting) use the following commands:

Switch buffers

C-x b - switch buffer
C-x right arrow - right-cycle through buffer
C-x left arrow - left-cycle through buffer

Close the buffer

C-x k

Split the current buffer

C-x 2

This allows you see multiple buffers on one screen. To move between these buffers use: C-x o

Set a single buffer as the current screen

C-x 1

If you ever used a terminal multiplexer like screen and tmux, the buffer commands will feel very familiar.

Exercise

Play around with buffers.

Quiz Question

# How do you kill a buffer? > - The text you are editing in Emacs resides in an object called a buffer. Each time you visit a file, a buffer is used to hold the file’s text. Each time you invoke Dired, a buffer is used to hold the directory listing. If you send a message with C-x m, a buffer is used to hold the text of the message. When you ask for a command’s documentation, that appears in a buffer named *Help*. > - Buffers exist as long as they are in use, and are deleted (“killed”) when no longer needed, either by you or by Emacs (e.g., when you exit Emacs, see Exiting Emacs). 1. [ ] C-x d 2. [ ] C-x x 3. [ ] C-x s 4. [x] C-x k