Skip to content

Multibuffers

A multibuffer is one editor view made of excerpts from several files. You edit it like any other file, and your changes are applied to the real files. Combined with multiple cursors, it makes wide changes fast.

Where multibuffers appear

  • Project search (cmd-shift-f): one excerpt per match.
  • Find all references (alt-shift-f12), and go to definition when a symbol has several definitions.
  • Diagnostics (cmd-shift-m): every error and warning in the project.
  • Git: the project diff shows each changed file as an excerpt. See Git.
  • Select all matches in a new view: alt-enter in the editor opens the current selections in a multibuffer.

Edit in place

Edit text in an excerpt as you would in a file. Changes appear in any open copy of that file. Save everything at once with cmd-s.

To change many places at once:

  1. Select one match with the mouse or cmd-d.
  2. Press cmd-d again to add the next match, or cmd-shift-l to select every match.
  3. Type. Every excerpt changes together.

Jump to the source file

Click a divider line between excerpts, or put the cursor in an excerpt and press alt-enter (Open Excerpts). With several cursors, each file opens at its cursor. cmd-alt-enter opens the file in a split.

To open an excerpt on double-click, set:

settings.json
{ "double_click_in_multibuffer": "open" }

The default is "select".

Excerpt context

Each excerpt shows a few lines around the match. Change this with excerpt_context_lines (default 2). shift-enter expands an excerpt, by expand_excerpt_lines lines (default 5).

  • cmd-up and cmd-down jump to the start of the current or next excerpt.
  • The outline panel lists files and matches in the active multibuffer. Set outline_panel.multi_buffer_hide_symbols to true to show only files and folders.