You might try using the Tidy command in the Latex bundle. It appears however that the command eats line endings, thus ruining your hard wraps. This command calls a well commented perl script which perhaps you can adjust to your needs. In general it seems that language specific functionality is implemented in bundle items rather than default TM behaviors. HTH
Peter
On 6/15/07, Plessl Christian christian@plesslweb.ch wrote:
Dear TextMate users
TextMate's LaTeX.bundle is really nice, but there is one thing that bothers me when editing LaTeX documents with hard line wraps.
Reformatting a paragraph (with Crtl + q) does not behave the way I would expect. Emacs is very smart when reformatting paragraphs in LaTeX and I would love to see some of these features in TextMate too:
- currently reformatting an equation or figure environment messes up
the layout completely
- section titles should be kept on a distinct line and moved within
the text
- reformatting paragraphs that are commented should adjust the line
length and keep the paragraph commented
- putting a single % character at the beginning of a line divides a
paragraph into 'reformatting units'. When reformatting a paragraph, the reformatting operation does not cross these % boundaries
- no reformatting should occur in math environments
In summary, reformatting should adjust the line-length but respect LaTex commands and environments.
It looks like the LaTeX mode currently does not provide LaTeX specific reformatting, but uses standard plain text reformatting.
Would it be difficult to change the behaviour? I assume that implementing smart Emacs-like LaTeX reformatting requires the bundle's grammar to provide a specific scope for marking the unit of text (i.e. a paragraph) that should be subject to the reformatting operation, e.g. text.tex.paragraph.
Does anyone have an idea, how to implement this?
Best regards, Christian
-- Christian Plessl christian@plesslweb.ch http://plesslweb.ch
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate