Step 3 of 5

Buffers and the buffer picker

Buffers and the buffer picker

When you opened example.rs in the last step, exercise.txt didn’t go anywhere. Helix keeps every file you open loaded in memory as a buffer, and switching files is really switching buffers. The one you’re looking at is just the one in front.

Space b opens the buffer picker: the list of everything that’s loaded, with the same fuzzy filter and preview as the file picker. It’s the quickest way back to a file you had open a minute ago — there’s no directory to think about, only the handful of buffers you touched.

A buffer doesn’t have to be a file. :new opens an empty scratch buffer with no filename at all, handy for pasting something you want to look at without saving it. One thing to know: Helix throws an empty scratch buffer away as soon as you leave it, so type something in first.

Work through the checklist below: make a scratch buffer, put a word in it, then use the buffer picker to move between it and this file.

Note

Buffers pile up over a long session. :buffer-close (or :bc) closes the current one, and the picker marks buffers with unsaved changes with a +.

  1. Make a scratch buffer with :new The statusline switches to [scratch] and the editor goes blank — type :new (or :n) and hit Enter.
  2. Put a word in it Press i, type scratch, and hit Escape — an empty scratch buffer is thrown away the moment you leave it.
  3. Go back to exercise.txt with the buffer picker Press Space b, highlight exercise.txt (type part of the name or use the arrows), then Enter.
  4. Hop back to the scratch buffer Space b again — highlight [scratch] (type scr or use the arrows), then Enter. The + marks its unsaved change.
Make a scratch buffer with :new The statusline switches to [scratch] and the editor goes blank — type :new (or :n) and hit Enter.

Next: Put a word in it

Loading editor…