Re: Formatting Posts With VI

From: Jim Richardson (warlock_at_eskimo.com)
Date: 09/12/04


Date: Sun, 12 Sep 2004 09:30:57 GMT


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, 11 Sep 2004 19:29:01 -0800,
 Floyd L. Davidson <floyd@barrow.com> wrote:
> Alan Connor <zzzzzz@xxx.yyy> wrote:
>>I just stumbled across this little 'trick' and thought it
>>was worth passing on.
>>
>>What the following allows you to do is to simply hit "v"
>>while you are in command mode, and it will re-format the
>>paragraph your cursor is currently on, to a maximum line
>>length of 75 characters, splitting and filling as it
>>works. (The -c option tells it to leave an indented first
>>line alone.)
>
> Lordy, isn't that thrilling...
>
> 1) Use 60-65 columns per line, not 70+.
>
> 2) Use emacs instead of vi and you can reformat
> your own paragraphs, *and* the ones you quote
> with a properly placed quote prefix on each
> line.
>
> Notice that I reforatted your paragraphs to 60 columns, like
> they should have been to start with, all with two keystrokes
> per paragraph.
>

In vim, set cursor to start of paragraph, in command mode, hit gq [down
arrow] or gqj and the text will be reflowed until the next newline. Or,
highlight the text, and hit (again in command mode) gq

You can also pass the text to an external command, such as par, to
format it, rather than the built in formatter, Also, see formatoptions
for more info on various formatting options :)

Vim, once you get the hang of a modal editor, it works great. I far
prefer it to Emacs/Nedit/whatever. As allways, IMHO.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFBRBVed90bcYOAWPYRAi3gAKDReq+K7Rvcq2L7fEXZfiTAzqh3zACeKCft
QKpoBqUlT7kYUsvpZf7GCn4=
=Iuml
-----END PGP SIGNATURE-----

-- 
Jim Richardson     http://www.eskimo.com/~warlock
When the DM smiles, it's already too late.


Relevant Pages

  • Re: Set list level number in MS Word with AppleScript
    ... Sometimes, an straight paragraph format gets inserted into a numbered list, ... tell paragraph format of selection to set style to style list ... Reading your code, it appears you are setting the "List Level" property, not ...
    (microsoft.public.mac.office.word)
  • Re: Office 2008 Question
    ... The "Format Painter" will do the same job these days, ... Elliott, of course, has to copy the whole paragraph mark because he has ... We Mac people had a fit when Microsoft made Office 4.2.1. ...
    (microsoft.public.mac.office.word)
  • Re: Word 2003 "Not Responding" after Find and Replace
    ... saved under a filename.doc format. ... and indicate where paragraph marks might sensibly ... The log file runs from 8-20MB. ... I had gotten it into the format of using linefeeds and not ...
    (microsoft.public.word.vba.general)
  • Re: automatic cross-references generate unwanted page breaks when
    ... Select each cell in the top row and go to Format Paragraph | Line and Page Breaks to see if the box is checked. ... > in front of figure or appendix cross-references. ... >> If you then go back and insert a page break before the caption by ...
    (microsoft.public.word.application.errors)
  • Re: Tab Stop Frustration in Word 2003
    ... To get this kind of layout, you use the Format> Paragraph dialog (or ... preferably set up a paragraph style) to set a "hanging indent". ... but also defines an invisible tab stop there. ... there's a whole other way to get this format: ...
    (microsoft.public.word.docmanagement)