A new version of fmt(1) (Castellano)

As the title says, fmtroff is another version of the old fmt(1) that you'll find in most unix-like systems:

It's a utility to format paragraphs in plain text.  The name I chose for my version may lead to confusion, the first thing to clarify is that fmtroff is NOT a roff parser, I chose a different name to prevent suggesting it's a replacement for the other versions, and the suffix ‘roff’ came about because my version, apart from improving some features present in other versions, also brings some innovations to make it easier (and more reliable) to work with roff files (to edit my novels I used groff, the GNU version.)

Download source file (fmtroff.c)

Tested in OpenBSD and Linux.  I hope you'll find it useful.

Documentation

To compile it, just run:

$ cc fmtroff.c -o fmtroff

May be, some day, I'll write a man page :-).  For now, for those already familiarized with fmt, the help that fmtroff prints will be enough to catch the subtle differences:

$ fmtroff -h
Usage: fmtroff [-bhlnp] [-w width] [file ...]
  -b   break sentences with a new line
  -h   print this help
  -m   try to skip mail headers and quoted text
  -n   format also lines beginning with a dot character
  -o   lowercase letters can begin a sentence (you may need this with
         man pages)
  -p   indent the whole paragraph copying the first line indentation
  -w   set maximum line width (default 72 columns)

Differences you can't deduce from the help above and it's important to consider:

To call it from Vi or Vim add a line like the following in your ~/.nexrc or ~/.vimrc:

map v !}fmtroff -np^M

Changelog


GO BACK HOME