Step 1 of 5

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.

Work through the checklist below to run your first two commands.

  1. Jump to line 5 with :5 Type :5 and hit Enter — the cursor lands on line 5 and the statusline shows 5:1.
  2. Go back to the top with :goto 1 The long form does the same thing — type :goto 1 and hit Enter.
Jump to line 5 with :5 Type :5 and hit Enter — the cursor lands on line 5 and the statusline shows 5:1.

Next: Go back to the top with :goto 1

Loading editor…