The word wrap command

The word wrap option is invoked with the WW command on the command line (a single W is reserved for the write command). This command causes the cursor to jump back to the left side of the screen when the word being typed goes beyond a prescribed column. This option is well known in the context of word processors, but can also be very useful for programming and especially for typing commentary or manuals that will be processed further with powerful formatting systems like TEX.

The syntax is as follows:

    WW#
where # is the column number at which you wish the word wrap to occur. So for example, WW78 sets the word wrap column at column 78. If the number is omitted, the editor reports the current word wrap mode. The command
    WW-
turns the word wrapping off.

The algorithm for wrapping is rather simple: whenever a character is entered from the keyboard, a check is performed to see whether it comes to the right of the `wrapping column'. If so, a search begins to find a blank or tab to the left of it (and also to the left of the `wrapping column'). If such a blank or tab is found a <Return> is inserted after it. This causes the new line to begin (usually) with a non whitespace character, while the trailing blank or tab in the old line indicates a so called soft linefeed.

For Fortran programming, a special word wrap command, the WWF command, is provided which installs a special wrapping formula for Fortran programs. In Fortran a continuation line needs a nonblank nonzero character in column 6 and columns after column 72 are not recognized as part of a program statement. Thus the formula for Fortran word wrap is to set the word wrap at column 72. When this column is reached, the cursor moves to column 6 of the next line and inserts a character ('+') there to indicate that it is a continuation line, before it copies the word being wrapped to that line. This indentation is accomplished by means of the auto-indent mode (explained below) and hence any preset values for that command will be erased when the Fortran word-wrap command is issued.

The word-wrap mode belongs to the current buffer. Each buffer may have its own mode. The setting of a buffer can be moved to the default string with the DS command and to the default file with the DW command (See the chapter on defaults p. [*]).

Summary of word-wrap commands:

WW# Normal word-wrap after column.
WWF Fortran formula wrap.
WW- Word wrap off.
WW Report word wrap status.

Rewrapping paragraphs can be done in one of two ways. These two ways have different definitions of a paragraph, and in the end a different effect. The commands are: