KLARTEXT GUIDE

How to wrap text at 80 columns on Mac

In KlarText, choose Edit ▸ Wrap at Column ▸ 80. Real line breaks are inserted at the 80-character boundary, paragraph breaks are preserved, and indented lines keep their indentation on every continuation line.

Eighty columns is a convention with a long memory — punched cards, then terminals, then the width that a git commit message, a README, a mailing-list post or a plain-text email is still expected to respect. Plenty of tools still assume it, and plenty of readers still notice when a file ignores it.

First, a distinction that trips people up.

Soft wrap is not what you want here

Every editor can display long lines wrapped to the window. In KlarText that is View ▸ Word Wrap. It is a display setting: the file on disk is unchanged, and the wrap moves when you resize the window.

Hard wrapping inserts actual newline characters into the file at the column you choose. That is what “wrap at 80 columns” means when a project’s contribution guide asks for it — the constraint has to survive being read by something other than your editor.

The Terminal way

fmt -w 80 input.txt > output.txt

or, for a version that breaks only at spaces and never mid-word:

fold -s -w 80 input.txt > output.txt

Both work on simple prose. Both need the output redirected to a second file, because you cannot write to the file you are reading, so there is a mv to follow. And fold in particular does not know about indentation: an indented block comes back with its continuation lines flush against the left margin.

The KlarText way

Edit ▸ Wrap at Column ▸ 80

The submenu also offers 72, 100 and 120, plus Custom… for anything else — 66 for a printed page, 50 for a narrow column.

Real newlines are inserted. Words are never broken across a line. And two things are preserved that the shell tools get wrong:

Blank lines stay blank lines. Paragraph boundaries survive the wrap instead of being merged into one long block.

Indentation carries. If a paragraph starts with four spaces or a tab, every continuation line produced by the wrap gets the same indent — so an indented block stays a block rather than falling apart at the left margin.

As with the other transforms: with text selected, only that selection is wrapped, expanded to whole lines. With nothing selected, the whole document is. One ⌘Z undoes it.

Choosing the width

72 is the traditional width for email and for the body of a git commit message. 80 is the general-purpose default. 100 and 120 suit wider screens and code-adjacent prose.

Undoing a wrap

If you inherit a file that is hard-wrapped and you want flowing paragraphs back, that is the reverse operation — see how to reflow hard-wrapped text.

Seeing where the lines actually end

View ▸ Show Invisibles draws a at every real newline and a · at every space, which makes it obvious at a glance whether a line break is in the file or just in the window. Turning it on before and after a wrap is the quickest way to confirm the transform did what you meant.

Related