Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.