Re: Formatting Posts With VI
From: Jim Richardson (warlock_at_eskimo.com)
Date: 09/12/04
- Next message: Madhusudan Singh: "[OT] Re: Fight against software aptents: did you register?"
- Previous message: Svein Hamnes Aaberge : "Re: how to mount usb digicam on SuSE 9.1?"
- In reply to: Floyd L. Davidson: "Re: Formatting Posts With VI"
- Next in thread: Buck Turgidson: "Re: Formatting Posts With VI"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Next message: Madhusudan Singh: "[OT] Re: Fight against software aptents: did you register?"
- Previous message: Svein Hamnes Aaberge : "Re: how to mount usb digicam on SuSE 9.1?"
- In reply to: Floyd L. Davidson: "Re: Formatting Posts With VI"
- Next in thread: Buck Turgidson: "Re: Formatting Posts With VI"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|