Sometimes, though not very often, I want to justify plain text. When I want to 
do this, I use vim since as far as I know there isn't a way to do it in BBedit.

But when I was doing it earlier today I thought, "Now wait a minute, there must 
be."

But "Justify" only appears on one page in the manual, and it's talking about 
line numbers.

(Justify is not built in to vim, but there's a macro for it).

I found a Justify Text.pl that does this, but it processes the entire file, and 
I want to either process a selection of the current paragraph, not the entire 
file.

==cut
#!/usr/bin/perl

# Make sure Text::Autoformat is installed; if in doubt, do this on the
# command line:
#   cpan Text::Autoformat

use strict;
use Text::Autoformat qw(autoformat break_TeX);

# Read in all data.
# TODO: This could be a problem for large input data. So what we really
# should do is to read everything until we find an empty  line. Then
# invoke autoformat on what we read so far, and output its result. Then
# go on.
my $rawtext;
while (<>) {
        $rawtext .= $_;
}

# Format it and output it again
print autoformat $rawtext, { justify => 'full', all=>1, right => 70 };
==cut


-- 
'Why?' he [Rincewind] said.  The world is going to end.  'What, again?'

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to