[TxMt] Re: How do you force carriage return after 80 characters?

Dr. Drang drdrang at gmail.com
Tue Dec 22 16:41:27 UTC 2009


It's not clear whether the OP is looking for soft wrapping or hard
wrapping. If it's just soft wrapping you're after, that's easy: turn
on View->Soft Wrap (as Steve said) and set the View->Wrap Column to
80. This will wrap the lines at 80 columns no matter how wide your
window is.

Be aware, though, that this will *not* put a line feed at the end of
each line. Such "hard wrapping" is traditional in Unix text editors,
but not in Mac editors. TextMate follows the Mac tradition and doesn't
have an automatic hard wrapping setting built in. In addition to the
previous suggestions, you could also create a command with

1. Save: Current File
2. Command(s): fmt -w 80
3. Input: Entire Document
4. Output: Replace Selected Text

Binding this to ⌘S will hard wrap the document to 80 columns every
time you save (assuming you use ⌘S to save rather than the menu).

For what it's worth, I used hard wrapping in my Linux days, and it
always screwed up the non-Linux users I shared text files with. Since
moving to the Mac, I've gone with soft wrapping and never looked back.



More information about the textmate mailing list