Step 5 of 7

Named registers

Named registers

To use a register other than the default, type " followed by the register’s name before a command. For example, "ay yanks the current selection into register a, and "ap pastes the contents of register a into the file.

Helix has 26 of these so-called “named registers” — one for each letter of the alphabet. That means you essentially have 26 separate clipboards, and it is completely up to you how to use them. Editors without registers force you to rely on the one system clipboard for everything.

For completeness, typing y on its own is the same as typing ""y: a yank into the default register.

Work through the checklist below.

  1. Yank the first line into register a Select the COPY ME INTO REGISTER a line (7gg then x), then type "ay.
  2. Yank the next line into register b Move down a line, select it with x, and type "by.
  3. Yank the next line into register c Same again, one line down — x then "cy.
  4. Yank the last line into register d And once more — x then "dy.
  5. Paste the lines back in the order b, d, a, c Move to the bottom of the file (ge), then paste the four registers back in this order — "bp, "dp, "ap, "cp. The step completes once all four lines are in place.
Yank the first line into register a Select the COPY ME INTO REGISTER a line (7gg then x), then type "ay.

Next: Yank the next line into register b

Loading editor…