Step 2 of 6

Opening multiple files

Opening multiple files

Now that you know how to hop between two buffers with gp and gn, let’s open a few more files at once.

Helix opens files with the :e command — type :e followed by a space and the filename. You can open as many files as you want, and they all stay in your buffer list while you work on other things. The list is kept in the order you opened the files, and gp and gn walk along it one buffer at a time.

There are three other files alongside the editor’s exercise.txt: a.txt, b.txt, and c.txt.

Work through the checklist below: open each of the other files with :e, then walk back along the list with gp until you reach exercise.txt again. In the next step you’ll learn a faster way to get around.

  1. Open a.txt The statusline will show the new name — type :e a.txt and press Enter.
  2. Open b.txt Same again — type :e b.txt and press Enter.
  3. Open c.txt One more — type :e c.txt and press Enter.
  4. Walk back to exercise.txt with gp Three hops back along the list — type gp three times.
Open a.txt The statusline will show the new name — type :e a.txt and press Enter.

Next: Open b.txt

Loading editor…