previous next top contents index framed top this page unframed
Table 8–1. Commands to Center Text on a Line
| Command | Center: |
|---|---|
| n.C | n lines (but not beyond end of window) |
| Q.C | all lines to end of window or page |
Table 8–2. Commands to Copy Text
| Command | Copy: |
|---|---|
| nC[C|W|L|P] | n objects at and after |
| QC[C|W|L|P] | all objects at and after |
| -nC[C|W|L|P] | n objects before |
| -QC[C|W|L|P] | all objects before |
For example, suppose the cursor is under the word “orange” in the following sentence:
The bright orange balloon rose into the sky.
^
Typing CW (Copy Word) copies the word orange and positions the cursor at the beginning of the second occurrence of the copied object:
The bright orange orange balloon rose into the sky.
^
The count modifier specifies the number of objects to be copied, not the number of times an object is to be copied. Using the same sample sentence, the 2CW command copies “orange balloon”:
The bright orange balloon orange balloon rose into the sky.
^
To copy the objects before the current object, modify the copy command with -. Again using the “orange balloon” sentence as an example, the -CW command copies the word bright and positions the cursor at the beginning of the first occurrence of the copied object:
The bright bright orange balloon rose into the sky.
^
Table 8–3. Text Rearranging Commands
| Command | Move current object: |
|---|---|
| nM[C|W|L|P] | n further |
| QM[C|W|L|P] | to end (of line, line, window, or buffer, respectively) |
| -nM[C|W|L|P] | n earlier |
| -QM[C|W|L|P] | to start (of line, line, window, or buffer, respectively) |
For example, suppose the cursor is positioned at the n in the word orange in the following sentence:
The bright orange balloon caught their attention.
^
The MW (Move Word) command moves the word orange one word to the right, positioning the cursor at the beginning of the object beyond the one moved:
The bright balloon orange caught their attention.
^
Typing MC (Move Character) moves the character at the cursor one position to the right, and positions the cursor at the character beyond the one moved:
The bright oragne balloon caught their attention.
^
The - modifier changes the direction of the move to be towards the left, or towards the beginning of the buffer. -MW applied to the original sentence results in:
The orange bright balloon caught their attention.
^
-M forms leave the cursor at the beginning of the object that
was originally located immediately before the moved object.
8.4. Break
The B (Break) command breaks
a line at the current cursor position
into two lines.
Modifiers are used
to specify where to position the first visible character on the
second line, and where to leave the cursor. See Table 8–4.
When a count n is specified, the first visible character on the second line is positioned to column n + 1. The “spaces” added by the nB forms are actually tab characters. They may be replaced with spaces when the file is written out in accordance with the rules in Section 1.11 of the MAINEDIT User's Guide.
When the - modifier is specified, the cursor is positioned after the last character on the first line. Otherwise, it is positioned on the first visible character of the second line.
Table 8–4. Commands to Break a Line
| Command | Break line at cursor, then: |
|---|---|
| B | remove spaces, cursor to second line |
| nB | indent n spaces, cursor to second line |
| QB | leave original spaces, cursor to second line |
| -B | remove spaces, cursor to end of first line |
| -nB | indent n spaces, cursor to end of first line |
| -QB | leave original spaces, cursor to end of 1st line |
The spaces inserted by the nJ forms are space characters, not tab characters.
Table 8–5. Commands to Join Two Lines
| Command | Join: |
|---|---|
| nJ | next to current line, n separating spaces |
| QJ | next to current line, leave original spaces |
| -nJ | current to previous line, n separating spaces |
| -QJ | current to previous line, leave original spaces |
Table 8–6. Commands to Convert to Lower/Upper Case
| Command | Convert: |
|---|---|
| nL[C|W|L] | n objects to lower case |
| QL[C|W|L] | all objects to lower case |
| nU[C|W|L] | n objects to upper case |
| QU[C|W|L] | all objects to upper case |
Table 8–7. Commands to Fill and Justify Text
| Command | Effect |
|---|---|
| .J | Fill current paragraph to right margin of window |
| $.J | Fill and preserve spaces after punctuation |
| n.J | Fill n lines |
| +.J | Fill and justify to right margin of window |
| -.J | Fill starting at cursor column |
| Q.J | Fill all remaining paragraphs in buffer |
| .mJ | Fill to right margin in column m |
| nQ.J | Fill next n paragraphs |
| (All modifiers may be combined; i.e., nQ+-.m.J means fill next n paragraphs from cursor column, justifying to column m). | |
The .J command with no modifiers fills the current paragraph. The current paragraph starts with the first non-blank line at or beyond the current line. It extends either to the first line that does not contain a visible character in the first column or to a page mark, whichever comes first. With this form of the command, it does not matter where the cursor is on the line. Multiple spaces in a filled paragraph are changed to a single space.
If a count (n) is specified, then only the first n lines of the paragraph are filled. If n is larger than the number of lines in the current paragraph, only the current paragraph is filled.
If n is not specified, the emphasis modifier (Q) means fill all remaining paragraphs in the buffer; if n is specified, it means fill the next n paragraphs.
The plus modifier (+) means fill with an even right margin (“justify”). Spaces are scattered in the filled text to make the right margin of all but (possibly) the last line even.
The .m modifier means fill with the right margin set to m (the displayed right margin of the window remains unchanged). If .m is not specified, the right margin of the window is used.
The minus modifier (-) means fill between the current column and the right margin only. This form of the command is useful when filling indented text. When using this form of the fill command, make sure that the cursor is positioned in the column at which filling is to begin; all characters to the left of this column are ignored and remain unaltered. Filling extends until MAINED encounters a line without a printing character in the current column. If, after filling, new line(s) are created, the text to the left of the current column on the existing filled lines is examined. If this text is identical on all filled lines, then that text is inserted to the left of the current column on every new line added as a result of the fill. Otherwise, blanks are added to the left of the current column on new line(s). This seems to give desirable results in most cases.
The dollar sign modifier ($) means to retain extra spaces after punctuation, if the spaces appeared in the paragraph before filling. The rule used is:
Some examples of the .J command are shown in Examples 8–8, 8–9, and 8–10.
Example 8–8. .J Command, Example 1
| A window that originally looks like this:
: : looks like this after .J:
: :
and looks like this after +.J:
: : The position of the cursor on the first line does not matter; i.e., it can be positioned anywhere on the first line. |
Example 8–9. .J Command, Example 2
| A window that originally looks like this:
: : looks like this after moving the cursor to each position indicated by ^ and typing -.J:
: : The cursor must be positioned as shown. |
Example 8–10. .J Command, Example 3
| A window that originally looks like this:
: : looks like this after -.J:
: : and looks like this after +-.J:
: : The newly created lines start with a pound sign and a blank, since that text started all of the original lines. The cursor must be positioned as shown. |