Re: GENERAL: Formatting text in Linux?



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

.



Relevant Pages

  • Re: A recorded macros to assign style "Normal" doesnt work
    ... Ctrl+Q is assigned to the ResetPara command, which sets the paragraph back ... resets character formatting rather than paragraph formatting. ... you don't need any macros for what you're doing. ...
    (microsoft.public.word.vba.general)
  • Re: Align top of marginpar with text - Additional space problem
    ... I found a nice redefinition of the marginpar command which, ... the \marginpar command (instead of the centering the margin note on ... paragraph and aligning them with the first line of the paragraph gives ... \marginpar{This is typeset when foo is false} ...
    (comp.text.tex)
  • Some Questions [Newbie]
    ... I'm trying to learn LaTeX by reading "The Not So Short Introduction to LaTeX 2e". ... Let's take commands which can have both optional and mandatory parameters. ... In paragraph 1.3.3 the author says the curly braces after the name of a command as in \commandshould be used to avoid `command' from "eating" the following whitespace characters. ...
    (comp.text.tex)
  • Re: Some Questions [Newbie]
    ... I'm trying to learn LaTeX by reading "The Not So Short Introduction to ... Are both the `documentclass' command and the `document' environment ... Paragraph 2.6. ... The `verb' command has a very strange syntax. ...
    (comp.text.tex)
  • Re: Using vi
    ... The ``{'' character moves the cursor to the beginning of the paragraph. ... passes the output through the fmt command, ... then execute the script to filter that range. ...
    (comp.unix.sco.misc)