vim hack of the day

set formatprg=fmt\ -w78

GNU fmt uses the line-breaking algorithm from TeX.

This works much, much better than vim’s built in formatter, and will make your emails look pretty; if like me you edit your emails in vim from mutt.

I can’t imagine using some lousy generic text box to edit email messages – although I am putting up with it for this blog!  I should switch back to blosxom, or spend a few minutes hacking up my own RSS export gadget.

I could write emails without line-breaks, one line per paragraph, but then my emails will appear ridiculously wide in your average brain-dead mail reader.  I’m looking at you, Outlook – do I want to read foot-and-a-half-wide columns of text?  There’s a reason why newspapers keep their columns narrow – it’s easier to read!

This entry was posted in Uncategorized. Bookmark the permalink.

1 Response to vim hack of the day

  1. Craig says:

    if you like fmt, you’ll probably love par. I’ ve been using it from within vi to reformat email (and code, esp. comments) since the mid 90s.

    Package: par
    Version: 1.52-3
    Description-en: Paragraph reformatter
    Greatly enhanced fmt type program by Adam M. Costello.
    Can be used within vi or other editor to automatically reformat text
    in a variety of ways.
    Perfect for use with email & usenet messages as it correctly handles
    multiple levels of quoting characters.
    This version includes a patch allowing multi-byte and multi-width character


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s