|
|
This item text has been erased.
7 responses total.
This response has been erased.
This response has been erased.
Thanks, Valerie. (Good idea on #2, says one who didn't think to (& still occasionally lives dangerously).)
This response has been erased.
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'.)
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)!
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.
|
|
- Backtalk version 1.3.30 - Copyright 1996-2006, Jan Wolter and Steve Weiss