Step 2 of 6

Deleting a selection

Deleting a selection

Now that you can make a selection, let’s act on one. The simplest action is d, which deletes whatever is selected.

To delete something:

  • make a selection — w for the word after the cursor, x for the line
  • press d

That’s the whole command. There’s no dd or dw in Helix: d only ever deletes the current selection, so a bare d with no selection removes just the character under the cursor.

Work through the checklist below. Delete the stray word on the second line, then clear out every line that starts with EXTRA.

  1. Delete the word JUNK Put the cursor on the J of JUNK, press w to select the word, then d.
  2. Delete an EXTRA line Move to a line starting with EXTRA, press x to select it, then d.
  3. Delete the remaining EXTRA lines Only the two KEEP lines should survive — x then d on each one.
Delete the word JUNK Put the cursor on the J of JUNK, press w to select the word, then d.

Next: Delete an EXTRA line

Loading editor…