A new version of fmt(1) (Castellano)

I used to post articles related to this topic here, but at some point I thought it better to dedicate this website exclusively to its original purpose, which is to publish my literary work.  I'll make an exception for this little program I wrote in C, since it's kinda related.

If you're a *nix user, you're surely used to edit plain text, using your preferred text editor.  While popular modern full-featured editors like Vim or GNU Emacs come with embedded paragraph formatting functions, with the old basic ones, like BSD nvi, you have to use external tools like fmt(1) (which you can also call from the editor, using key bindings.)  Anyway, as I explain in the top comment in the code itself, none of the existing tools to format plain text paragraphs fully satisfied me, which is why I wrote my own.

Those familiar with unix-like systems know well what troff is, a very versatile tag like text formatting language, which among other things has been used by many to give format to published known books.  To edit my novels I used groff, the GNU version.   Well, the code I'm posting here, apart from improving some features present in other fmt versions also brings an innovation to make it easier (and safer) to work with troff files.

Download (fmtroff.c)

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

Changelog


GO BACK HOME