Add Line Numbers

Prefix each line with a number. Configurable start, padding and separator, so the output lines up in a monospace block.

Numbered
—

Worked example

Padding to width 3 turns 1., 2., 10. into a column where the text starts at the same offset on every line. Without padding, a list crossing 9 to 10 shifts sideways.

Line numbers do two things: they let you refer to a specific line in a review, and they make a pasted block survive a channel that would otherwise reflow it. Both are practical, neither is cosmetic.

Padding

A monospace block with unpadded numbers looks ragged as soon as the count crosses a power of ten. Padding to the width of the largest number fixes it, and the width is predictable: 3 for lists under 1000, 4 for anything longer.

Skipping blanks

When quoting code, numbering blank lines wastes attention on nothing. When quoting a log, blank lines are often meaningful separators and should be numbered. There is no universal default, so it is a toggle.

Starting from something other than 1

Starting at a nonzero value matters when you are numbering a fragment of a longer file — a 40-line excerpt from line 1200 onward should carry the real line numbers, not restart at one.