Step 1 of 6

The command line

The command line

Some of what Helix does isn’t bound to a key. Instead, it lives behind the command line, which you open with : in normal mode. A prompt appears at the bottom of the editor, you type a command, and Enter runs it. If you change your mind, Escape closes the prompt without doing anything.

You’ve been using it already: :o opens a file. Saving and quitting live here too: :w writes the buffer, :q quits, :wq does both, and :q! quits without saving. This embedded editor has nowhere to go when it quits, so practice :w here and keep the rest for a real terminal. A few more commands are useful time and time again:

  • :goto 5, or just :5 for short, jumps to line 5
  • :reload discards your edits and re-reads the file from disk
  • :buffer-close, or :bc, closes the current buffer
  • :theme switches the color scheme
  • :set and :toggle change editor settings for the session

Helix has no ranges or addresses to learn — commands that work on text act on your selection, which you already know how to make.

The checklist starts with a warm-up from lesson 16. Then run your first two commands.

  1. Change both todo lines to done Warm-up from lesson 16 — record the edit on the first line, then replay it on the second.
  2. Jump to line 5 with :5 The short form, at the : prompt — the statusline shows 5:1 on arrival.
  3. Go back to the top with :goto 1 The long form does the same thing.
Change both todo lines to done Warm-up from lesson 16 — record the edit on the first line, then replay it on the second.

Next: Jump to line 5 with :5

Loading editor…