No Next Item No Next Conference Can't Favor Can't Forget Item List Conference Home Entrance    Help
View Responses


Grex Info Item 15: Word Wrap
Entered by popcorn on Tue Dec 22 03:52:54 UTC 1992:

This item text has been erased.

7 responses total.



#1 of 7 by popcorn on Tue Dec 22 03:55:10 1992:

This response has been erased.



#2 of 7 by popcorn on Tue Dec 22 03:55:50 1992:

This response has been erased.



#3 of 7 by davel on Tue Dec 22 13:22:49 1992:

Thanks, Valerie.  (Good idea on #2, says one who didn't think to (& still
occasionally lives dangerously).)


#4 of 7 by popcorn on Thu Dec 24 04:37:00 1992:

This response has been erased.



#5 of 7 by remmers on Thu Dec 24 16:09:08 1992:

You're welcome.

Now, the bad news is that although vi has 'wrapmargin' to wrap words at
the right margin as you enter text, it has no built-in command to
reformat text *already* entered.

However, the GOOD news is that most Unix systems these days have a 'fmt'
command that reformats text to a right margin, so you can get at that
within vi as a '!' command.  For example, to reformat a paragraph:

   (1) type '{' to move to the beginning of the paragraph
   (2) type '!' to initiate filtering through an external command
   (3) type '}' to select all text to the end of the paragraph (the cursor
   will move to the bottom line of the screen and a '!' appear at this
   point)
   (4) type 'fmt <return>' to run the selected paragraph through 'fmt'.
   The paragraph will be reformatted before your very eyes!

'fmt' accepts an argument specifying the right margin, and defaults to
something like column 72 if you don't supply it.  e.g. 'fmt -75' sets
the right margin to column 75.  If you have an 80-column screen, this
is equivalent to 'set wm=5' in vi.  (vi accepts 'wm' as an abbreviation
for 'wrapmargin'.)


#6 of 7 by davel on Thu Dec 24 17:43:16 1992:

Thank you very much, John.  (What defines "paragraph", BTW? An empty or
all-blank line or something?)

I'm to the point with vi that my fingers know how to do the stuff I do, but
that locating the new functions in the doc when I want them (even to find
they exist) is kind of hard.  This one example gave me about 4 useful new
techniques (including the fmt filter)!


#7 of 7 by tsty on Sun Dec 27 08:43:28 1992:

remmers wrote a c-thingie for me (and my butt-dumb terminal) which
is named wrap.source in my subdirectory. Works jsut fine for me, but
then I don' use vi or anything fancy like that.
  
But it does "reformat text *already* entered" which is why I 
mentioned it.

Response not possible - You must register and login before posting.

No Next Item No Next Conference Can't Favor Can't Forget Item List Conference Home Entrance    Help

- Backtalk version 1.3.30 - Copyright 1996-2006, Jan Wolter and Steve Weiss