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.
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.