Small Title

Txtfmt (The Vim Highlighter)

Txtfmt is a Vim plugin that provides a sort of "rich text" capability for plain text files in Vim. The plugin permits you to highlight arbitrary regions of text with foreground colors, background colors, and all combinations of underline, bold, italic, etc...

See below for screenshots illustrating some of the many ways Txtfmt can be used...

Block diagram created with Dr. Chip's "drawit" plugin and formatted with Txtfmt

Txtfmt 2.0 default "test page"

This screenshot shows a portion of a "test page" created by Txtfmt version 2.0 with default settings.

Using Txtfmt as a "standalone" filetype

Using Txtfmt with other filetypes (e.g. "C")

This screenshot shows a C source file containing "nested" Txtfmt regions embedded within a C comment. Note that the nesting of Txtfmt formatting regions is possible because of the "ft=c.txtfmt" in the Vim modeline.

:help txtfmt-'nested'

Using Txtfmt in conjunction with Ned Konz' TVO (The Vim Outliner) plugin

This screenshot shows how you can use Txtfmt to highlight the ordinary text within *.otl files created with Ned Konz' TVO (The Vim Outliner) plugin. To make it work, you simply need to set filetype to "otl.txtfmt" rather than "otl". The Txtfmt "modeline" sets the 'nested' Txtfmt boolean option so that the Txtfmt regions can be nested within TVO regions.

Important Caveat: Because of an issue with the way TVO currently sets b:undo_ftplugin, you should set filetype either with a modeline or with an autocommand, but not with both!

Although the colors I am using are admittedly a bit gaudy, the intent is simply to demonstrate the creation of arbitrary highlighting regions within the TVO outline blocks.

Using Txtfmt in a vhdl source file

This example was created in response to a request from a user on the Vim mailing list. It shows how Txtfmt could be used to mark entire blocks of vhdl code in a persistent manner. Distinct "red background, bold-italic" and "yellow background, italic" blocks are created to illustrate how the programmer might adopt his own highlighting conventions to represent the maturity of a block of code.