Increment and Decrement (Ctrl-A / Ctrl-X)

Find the next number, add or subtract โ€” with counts.

Keys: Ctrl-A, Ctrl-X

Ctrl-A increments the next number on the line; Ctrl-X decrements. With a count, it adds/subtracts that much. Combined with macros and :norm, generates sequences instantly.

Increment / Decrement

Ctrl-A adds 1 to the next number on the line. Ctrl-X subtracts 1. With a count: add/subtract that count.

Sequence Effect
Ctrl-A Increment next number on line by 1
10Ctrl-A Increment by 10
Ctrl-X Decrement next number
{count}Ctrl-X Decrement by count
{count}gCtrl-A Increment by count, with PROGRESSIVE step on visual selection

Worked example โ€” Ctrl-A and Ctrl-X

Bump numbers up or down.

Step 1 ยท
pattern.increment
Step 2 ยท Ctrl-A ยท Ctrl-A โ€” number under (or to the right of) the cursor incremented.
Ctrl-A โ€” number under (or to the right of) the cursor incremented.
Step 3 ยท 5Ctrl-A ยท 5Ctrl-A โ€” increment by 5.
5Ctrl-A โ€” increment by 5.

โ–ถ Try this in the simulator

Watch

See also: Counts, Normal ({key::norm})