By filling I mean, of course, taking a ragged paragraph of text and
reformatting it so it fits neatly into a maximum width of (say) 73
columns - what one might do with "g q }" in vim.
Also, having vi wrap at the said column whilst typing would be nice.
Is there a way of doing this?
Thanks in advance!
--
Alan Mackenzie (Nuremberg, Germany).
In vi, I'd probably do
:%!fmt
> Also, having vi wrap at the said column whilst typing would be nice.
> Is there a way of doing this?
Probably. Sorry.
--
kasmra
:wq
SM <kas...@ne-spamon.gmail.com> wrote:
> 2009-10-30, Alan Mackenzie skribis:
>> By filling I mean, of course, taking a ragged paragraph of text and
>> reformatting it so it fits neatly into a maximum width of (say) 73
>> columns - what one might do with "g q }" in vim.
> In vi, I'd probably do
> :%!fmt
This doesn't do quite what I want. It fails to preserve prefices like
">> >" in newsgroups postings. But I forgot to say I wanted this. But
thanks muchly for the idea of using an external program (which hadn't
occurred to me). I've hacked an AWK script which DTRT, more or less, and
then mapped the key `q' to invoke it on the current paragraph.
>> Also, having vi wrap at the said column whilst typing would be nice.
>> Is there a way of doing this?
> Probably. Sorry.
Hey, you've nothing to apologise for. ;-) I found out there's an option
`wraplen' (aka `wl') on my ISP's vi which does just what I want.
So, all in all, a totally successful hack. Thanks for the tip!
set wm=10 will cause the line to hard wrap at column 70.
It assumes the old ASCII screens of 80 characters width.
>>> By filling I mean, of course, taking a ragged paragraph of text and
>>> reformatting it so it fits neatly into a maximum width of (say) 73
>>> columns - what one might do with "g q }" in vim.
>> In vi, I'd probably do
>> :%!fmt
> This doesn't do quite what I want. It fails to preserve prefices like
> ">> >" in newsgroups postings. But I forgot to say I wanted this. But
> thanks muchly for the idea of using an external program (which hadn't
> occurred to me). I've hacked an AWK script which DTRT, more or less, and
> then mapped the key `q' to invoke it on the current paragraph.
“par” handels prefixes and suffixes, according to its manpage.
--
flori
Vim-Hilfe auf Deutsch http://www.florianrehnisch.de/vimhelp/
Mein Zigarettenkonsum der letzten sieben Tage:
Fr:27 Sa:29 So:30 Mo:25 Di:31 Mi:35 Do:30
>>> Also, having vi wrap at the said column whilst typing would be nice.
>>> Is there a way of doing this?
> set wm=10 will cause the line to hard wrap at column 70.
> It assumes the old ASCII screens of 80 characters width.
It should wrap at 10 columns from the right margin, regardless of
the terminal width. If you have a version of vi that wraps at
(80-wm) instead of (width-wm) when the width isn't 80, that's a bug.
--
Geoff Clare <net...@gclare.org.uk>
On "my" vi, there's an option "wraplen" (abbreviated "wl") which you set
to the amount of text you want to wrap, not the size of the hole you want
to leave after it. This is a vi on FreeBSD, but I don't know how to get
this vi to display its version number.