Step 1 of 8

Windows are a viewport into a buffer

Windows are a viewport into a buffer

Before we dive in, a small warning: Helix’s system of buffers and windows is probably quite different from what you’re used to in other text editors. Try to forget what you already know about how files, windows, and tabs work in your current editor — reconciling the two will only make things harder.

Recall from the last lesson: a buffer is the in-memory text of a file, and Helix can hold many of them at once. Closely related is the idea of windows. A window is a viewport into a single buffer — the “thing” you’re looking through to see the contents of your file. If you can see text on the screen — congratulations! You’re looking at a buffer through a window.

Up until now we’ve worked with one window filling the whole screen, but Helix can divide the screen into many windows, each peering into a different buffer. You can use this to keep multiple files visible at the same time. (Helix has no tabs — windows and buffers are the whole story.)

The editor has exercise.txt open, and there’s another file alongside it called myfile. The checklist starts with a warm-up from lesson 12. Then open myfile in a new, horizontally split window, which puts both files on screen at once, one above the other.

  1. Open myfile in this window Warm-up from lesson 12 — the command that loads a file into a new buffer.
  2. Switch back to exercise.txt Lesson 12 again — hop back along the buffer list.
  3. Open myfile in a split Type :hsplit myfile and press Enter — a second window opens underneath, peering into myfile.
Open myfile in this window Warm-up from lesson 12 — the command that loads a file into a new buffer.

Next: Switch back to exercise.txt

Loading editor…