I made a quick PopClip extension today for adding hard line wrapping to blocks of text. In general I’m a fan of letting text wrap automatically, but when I’m coding I prefer hard line breaks at 70-80 columns. Easy to do in almost any decent text editor, but elsewhere (ahem, Xcode) I wanted a fast way to do it.

You can install the extension from the latest version of Brett’s PopClip Extensions (download directly below), and the source is available on GitHub.

Credit for the heart of the wrapping code goes to Allan Odgaard of TextMate fame because why reinvent the wheel?

When you install the extension you can define the column at which the text will wrap. You can also define an alternate column, which can then be accessed by holding down Option when clicking the extension (which shows up as \n in your PopClip bar). Holding down Command will unwrap selected text, removing newlines at line endings but preserving multiple consecutive newlines and trailing space.

Just a quick side project, but I thought others might find it useful. Of course, I’d bet money something like this already exists, but it was a nice break from other tasks anyway.

Brett's PopClip Extensions v1.45.2

A few PopClip extensions for Markdown writing and other useful tools

Published 11/30/14.

Updated 02/07/23. Changelog

DonateMore info…