Is there a way to line wrap selected text in TextMate?

I sometimes write long comments in my code. I hate manually wrapping them after 80 characters, and rewrapping them if I edit the comment. Is there a way (or a bundle) that will apply an 80 character line wrap to some selected text?


Solution 1:

Text » Reformat Selection. It rewraps the current paragraph and uses the wrap column configurable in Edit » Wrap Column for the resulting line width.

For this command, any contiguous series of lines is a paragraph, so if you wrapped it once, then edited something in the middle or changed the wrap column, you can just run it again and it'll fix the line wraps. Use an empty line as separator.

To unwrap again, select Text » Unwrap Selection.


TextMate also supports automatic line wrapping of long lines via View » Soft Wrap.

Solution 2:

Another addition to Daniels answer: The default shortcut is Control + Q.