Emacs: Switch Buffers, Ido Tutorial

Buy Xah Emacs Tutorial. Master emacs benefits for life.
, , …,

This page is a tutorial on switching buffers in emacs. If you don't know what buffers are, first see: Emacs: List Buffers.

When you call switch-to-bufferCtrl+x b】, emacs prompt you for a name, and you can press Tab ↹ for name completion.

Emacs 22 (released in 2007) has a improved switch buffer command called ido-mode. It will show a list of candidates AUTOMATICALLY as you type (no need to press Tab ↹ first), and you can also use arrow keys to navigate among opened files, with recently opened shown first.

emacs ido-switch screenshot 2013-03-31
Emacs ido-switch-buffer screenshot

Ido Configuration

To make ido-mode default for switching buffer, put the following in your emacs init:

;; make buffer switch command auto suggestions, also for find-file command
(ido-mode 1)

With the above, the command switch-to-bufferCtrl+x b】 will call ido's version.

Make Ido Suggestions Display Vertically

emacs ido-mode show vertical 2014-10-06
emacs “ido-mode” show vertical
;; make ido display choices vertically
(setq ido-separator "\n")

;; display any item that contains the chars you typed
(setq ido-enable-flex-matching t)

Ido Keybinding

Switching Next/Previous User Buffers

Here's custom commands that lets you switch to next/prev buffers and skip emacs generated buffers. Emacs: Switching Next/Previous User Buffers.

Create New Empty Buffer

Emacs: New Empty Buffer

Like it?
Buy Xah Emacs Tutorial
or share
blog comments powered by Disqus