Hello. Can I "save a file with line breaks" i.e. have TextMate save a text file with hard wrap?
(I did a little googling on this topic w/r/t TextMate and found the answers fairly confusing.)
Thanks!
--andreas
On 1/10/2006, at 6:58, Andreas Duus Pape wrote:
Hello. Can I "save a file with line breaks" i.e. have TextMate save a text file with hard wrap?
So you want to keep it soft wrapped in the buffer, but the version which goes to disk should be hard wrapped?
There is no built-in support for this, but you could overload ⌘S to run a command which takes Entire Document as input and does something like:
fold -sw$TM_COLUMNS >"$TM_FILEPATH"
This would then save a hard wrapped version on ⌘S. Although you would need to check for when TM_FILEPATH is unset, and open a file dialog (e.g. via AppleScript) to request the initial filename.
On 1/10/2006, at 11:23, Allan Odgaard wrote:
[...] you would need to check for when TM_FILEPATH is unset, and open a file dialog (e.g. via AppleScript) to request the initial filename.
Actually, by setting the command to save current file, TM would take care of that for you. The file would be saved twice, but I don’t think that is cause for worry.