Incrementing and decrementing
Helix can do arithmetic on the number under your cursor:
Ctrl-a adds one
Ctrl-x subtracts one
Both take a count, so 10 followed by Ctrl-a adds ten. They understand
negative numbers and will happily carry across digits, so 9 becomes 10
and, with -1 selected, it becomes 0.
One thing to watch: these keys act on the selected text. A bare cursor
selects one character, so on a single-digit number that’s fine, but on
8080 it changes only the digit under the cursor. Select the whole number
first — e from its first digit does it — and the arithmetic applies to all
of it.
Work through the checklist below to fix the numbering, then bump the port.
1 2 3 4 5
Renumber 2) Next point with Ctrl-a Move down to line 3 — the cursor sits on the 2 — and press Ctrl-a.
Renumber 3) Another point with Ctrl-a Move down a line and press Ctrl-a again.
Renumber 6) Last point with Ctrl-x Move down a line and press Ctrl-x — the number goes down instead.
Select 8080 with e, then press Ctrl-a Move down to the last line, press e to select the whole number, then Ctrl-a.
Add ten more with 10 then Ctrl-a The number is still selected — type 10, then press Ctrl-a.
Next: Renumber 3) Another point with Ctrl-a
Next: Renumber 6) Last point with Ctrl-x
Next: Select 8080 with e, then press Ctrl-a
Next: Add ten more with 10 then Ctrl-a
Last one — goal check runs when it's done
Nice work!
Up next: Commenting.