Editing

Since mdoc is an ASCII-clean text format, it may be edited in any text editor. In this section, I introduce a variety of editors available on most UNIX systems. Since this topic is exhaustively covered in most any introductory UNIX book, I only introduce portable editors.

Ed

The ed utility is a line editor standardised by POSIX.1-2008. The concept of a line editor may be familiar to those who have used a typewriter or teleprinter, where only the current line of input may be edited (or viewed, in some cases) at a time.

Its inclusion is largely for historical reasons, as using ed can be a frustrating experience for those accustomed to visual editors. I don't recommend using this utility for mdoc, although its function as a line editor makes it perfect for the task.

Ex, Vi

The vi and ex editors were powerful additions to the UNIX system: they allowed visual editing of files (versus line editing as with ed). This editor has inspired a raft of clones, but being standardised, some form of the utility is available on all UNIX systems. Furthermore, the vim clone of vi comes bundled with mdoc syntax highlighting.

Last edited by $Author: kristaps $ on $Date: 2011/11/04 01:06:28 $. Copyright © 2011, Kristaps Dzonsons. CC BY-SA.