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. Work through the checklist: opening myfile in a new, horizontally split window puts both files on screen at once, one above the other.

  1. Open myfile in a split Type :hsplit myfile and press Enter — a second window opens underneath, peering into myfile.
Open myfile in a split Type :hsplit myfile and press Enter — a second window opens underneath, peering into myfile.

Last one — goal check runs when it's done

Loading editor…