Re: GENERAL: Formatting text in Linux?
- From: Alan Connor <zzzzzz@xxxxxxxxxxx>
- Date: Fri, 02 Sep 2005 12:38:31 GMT
On comp.editors, in <slrndhgf2q.fve.ohmster@xxxxxxxxxxx>, "The
Ohmster" wrote:
> On 2005-09-02, Alan Connor <zzzzzz@xxxxxxxxxxx> wrote:
>
>> On comp.editors, in <slrndhfqkc.16k.zzzzzz@xxxxxxxxxxx>, "Alan
>> Connor" wrote:
>>
>><snip>
>>
>>
>>> You have to do it one paragraph at a time, though. I don't
>>> know how to make vi do it on a whole file with a lot of
>>> individual paragraphs with a single command.
>>
>> Got it:
>>
>> map V :%!par w50^V^M
>>
>><snip>
>>
>> AC
>
> Phew! That will take a little time to study and digest. Saved
> to a text file, thanks Alan.
Hi Ohmster,
Not really hard: Hit capital V and the whole file (% = 1,$) is
piped to par w50 with the ! command, and I guess the Sychronous
Idle+Carriage Return(^V^M) tells vi to accept the standard
output of par back where the original file was (overwrites the
buffer). It must. The ":" is just the ex command, like you'd use
to type :wq to exit vi. Or :s/X/Y/g.
You have the ascii utility? Try these:
ascii '^V'
ascii '^M'
ascii '^J'
ascii '^I'
Then feed the command the synomyms, like:
ascii '\n'
Here are some useful links about vi macros:
This one first: http://soma.npa.uiuc.edu/docs/vi.macros
http://grox.net/doc/unix/exrc.php
http://grox.net/doc/unix/exrc.txt
There's also some good macro stuff in the VI FAQ, which is posted
on this group regularly.
Later,
AC
.
- Follow-Ups:
- Re: GENERAL: Formatting text in Linux?
- From: Alan Connor
- Re: GENERAL: Formatting text in Linux?
- References:
- GENERAL: Formatting text in Linux?
- From: The Ohmster
- Re: GENERAL: Formatting text in Linux?
- From: Alan Connor
- Re: GENERAL: Formatting text in Linux?
- From: Alan Connor
- Re: GENERAL: Formatting text in Linux?
- From: The Ohmster
- GENERAL: Formatting text in Linux?
- Prev by Date: Re: GENERAL: Formatting text in Linux?
- Next by Date: Re: GENERAL: Formatting text in Linux?
- Previous by thread: Re: GENERAL: Formatting text in Linux?
- Next by thread: Re: GENERAL: Formatting text in Linux?
- Index(es):
Relevant Pages
|
|