For many reasons, I would like to have the possibility to hard wrap my file (mainly for LaTeX files).
Reformat paragraph alone (^Q) does not work in the way I like, but selecting a line Shift-cmd-L and ^Q does what I want.
What I would like to know is whether there is a way to automate this procedure for a file (all the line in the file), or whether I have to write my own command for this (or there is a script called by ^Q).
All the best
Guido -- Dr Guido Governatori School of Information Technology and Electrical Engineering The University of Queensland Brisbane, Queensland, 4072, Australia Phone: +61-(0)7-336 52907 Fax: +61-(0)7-336 54999 http://www.governatori.net/TextMate http://www.defeasible.org
On 31 Oct 2007, at 09:46, Guido Governatori wrote:
For many reasons, I would like to have the possibility to hard wrap my file (mainly for LaTeX files).
Reformat paragraph alone (^Q) does not work in the way I like, but selecting a line Shift-cmd-L and ^Q does what I want.
What I would like to know is whether there is a way to automate this procedure for a file (all the line in the file), or whether I have to write my own command for this (or there is a script called by ^Q).
Please forgive me, if I understood your problem wrong!
Did you try to set the "wrap column" to what ever; select all (APPLE +A); press CTRL+Q? That you could record as macro.
Or is there something I missed?
Best,
--Hans
On 31 Oct 2007, at 09:46, Guido Governatori wrote:
For many reasons, I would like to have the possibility to hard wrap my file (mainly for LaTeX files).
Reformat paragraph alone (^Q) does not work in the way I like, but selecting a line Shift-cmd-L and ^Q does what I want.
What I would like to know is whether there is a way to automate this procedure for a file (all the line in the file), or whether I have to write my own command for this (or there is a script called by ^Q).
Please forgive me, if I understood your problem wrong!
Sorry I should have been more precise.
Did you try to set the "wrap column" to what ever; select all (APPLE+A); press CTRL+Q?
I have tried it but it does not do what I want.
The problem with CTRL-Q is that it does not "respect" LaTeX constructions.
For example
long line to be wrapped [ math ] long line to be wrapped
with the proposed solution produces
long line to be wrapped [ math ] long line to be wrapped
while with the one line at a time reformatting the above case is handled properly.
Thanks anyway
Guido
-- Dr Guido Governatori School of Information Technology and Electrical Engineering The University of Queensland Brisbane, Queensland, 4072, Australia Phone: +61-(0)7-336 52907 Fax: +61-(0)7-336 54999 http://www.itee.uq.edu.au/~guido http://www.governatori.net http://www.defeasible.org
On 31 Oct 2007, at 08:46, Guido Governatori wrote:
Reformat paragraph alone (^Q) does not work in the way I like, but selecting a line Shift-cmd-L and ^Q does what I want.
What I would like to know is whether there is a way to automate this procedure for a file (all the line in the file), or whether I have to write my own command for this (or there is a script called by ^Q).
Just set up a command that pipes the text through fmt.
On 31/10/2007, at 7:34 PM, Andy Armstrong wrote:
On 31 Oct 2007, at 08:46, Guido Governatori wrote:
Reformat paragraph alone (^Q) does not work in the way I like, but selecting a line Shift-cmd-L and ^Q does what I want.
What I would like to know is whether there is a way to automate this procedure for a file (all the line in the file), or whether I have to write my own command for this (or there is a script called by ^Q).
Just set up a command that pipes the text through fmt.
It merges lines.
line [ math ] line
is transformed into
line [ math ] line
But the worst part is with comments :-(
Thanks anyway
Guido -- Dr Guido Governatori School of Information Technology and Electrical Engineering The University of Queensland Brisbane, Queensland, 4072, Australia Phone: +61-(0)7-336 52907 Fax: +61-(0)7-336 54999 http://www.governatori.net/TextMate http://www.defeasible.org
Guido Governatori <guido@...> writes:
On 31 Oct 2007, at 08:46, Guido Governatori wrote:
Reformat paragraph alone (^Q) does not work in the way I like, but selecting a line Shift-cmd-L and ^Q does what I want.
What I would like to know is whether there is a way to automate this procedure for a file (all the line in the file), or whether I have to write my own command for this (or there is a script called by ^Q).
What about cntrl-Q followed by Tidy (i.e. Latex-tidy, it's in the Latex Bundle)?
Piero