MAINEDIT User's Guide, Chapter 16

previous   next   top   contents   index   framed top   this page unframed


16. Setting and Clearing Options

The .O command is used to set editor options; the -.O command clears options. See Table 16–1.

Table 16–1. Editor Option Commands
Command Action:
.O set BOOLEAN editor option
-.O clear BOOLEAN editor option
Q.O set option globally (if also a local option)
Q-.O clear option globally (if also a local option)
.O? show settings of all options
.O optionName value set the value of a non-BOOLEAN option

These commands prompt for the name of an option to be set or cleared. Only a unique prefix of an option need be typed to select the option. Case is ignored. If you type ? in response to the “Option (? for summary):” prompt, MAINED displays a summary of available options and their current settings.

MAINEDIT options are divided into three categories: global options (those applicable to the entire editor session), local options (those applicable only to the current buffer), and front-end-specific options (applicable to a particular front end).

Currently available options are shown in Table 16–2.

Table 16–2. Options
Edit (Global) Options Type
proportionalWindowsMode BOOLEAN
readOnly BOOLEAN
statusLine BOOLEAN
leftBorder BOOLEAN
rightBorder BOOLEAN
autoHorizontalScroll BOOLEAN
maxUnanchoredProportionalWindows INTEGER
Buffer (Local) Options Type
lineNumber BOOLEAN
readOnly BOOLEAN
statusLine BOOLEAN
leftBorder BOOLEAN
rightBorder BOOLEAN
autoHorizontalScroll BOOLEAN
MAINED Options Type
stickyTabs BOOLEAN
insertModeDefault BOOLEAN
overstrikeModeDefault BOOLEAN
lowerCaseMode BOOLEAN
upperCaseMode BOOLEAN
wordWrap BOOLEAN
countPageMarksAsLines BOOLEAN

16.1. Options That Are Both Global and Local

The following options can be both global and local:

lineNumber
readOnly
statusLine
leftBorder
rightBorder
autoHorizontalScroll

For options that can be both global and local:

16.1.1. lineNumber Option

When the lineNumber option is set for a buffer, the absolute line number (where the first line of the buffer is numbered 1) is displayed to the left of each line when the buffer is visible. The line numbers are not part of the data in the buffer and are not saved when the buffer is saved to a file.

16.1.2. readOnly Option

When the readOnly option is set for an edit buffer, MAINED does not allow you to change the buffer. If you attempt to do so, MAINED rings the terminal bell. By default, readOnly is not set.

readOnly applies to individual buffers rather than to an entire edit session. To change the value of the readOnly option for a particular buffer, you must move the cursor into the buffer and issue the appropriate options command.

16.1.3. statusLine Option

When the option statusLine is set for an edit buffer (the default), a status line is displayed at the top of the editor window for that buffer whenever the buffer is on the screen. If this option is cleared, the status line is not displayed and every line of the window is used for text. Note that the contents of the screen can become very confusing if there is more than one window on the screen but some windows do not have status lines.

16.1.4. Border Options

The borders are the colons usually displayed at each side of the screen. The left and right borders are shown on a window for a given buffer if and only if the leftBorder and rightBorder options are set for that window. The default is both border options set.

16.1.5. autoHorizontalScroll Option

The option autoHorizontalScroll, when set (it is clear by default), does not allow the cursor to move horizontally outside the current window. The editor effectively moves the window with the cursor by issuing a Q-X command with the appropriate numeric argument to keep the cursor from leaving the window. When the option is clear and the cursor is located on a column to the right or left of the contents of the window, the cursor is shown on the right or left border of the window (if the borders are present; if the borders are not present, the cursor is displayed on the rightmost or leftmost column of the window).

16.2. Global Option

The only options that are global but not local are the proportionalWindowsMode and maxUnanchoredProportionalWindows option.

16.2.1. proportionalWindowsMode Option

When the proportionalWindowsMode option is set, all unanchored windows always occupy 1/mth of the screen, where m is the number of visible unanchored windows. The minimum number of rows in each window (not including the status line) is set with the ..{n}B and ..{n}F commands (the default is 1). The default is proportionalWindowsMode clear. Note that the ..B command can be used to make all unanchored windows proportional when the proportionalWindowsMode option is clear. It does not change the setting of the proportionalWindowsMode option.

16.2.2. maxUnanchoredProportionalWindows

maxUnanchoredProportionalWindows is relevant only if proportionalWindowsMode is in effect. If maxUnanchoredProportionalWindows is zero (the default), there is no limit on the number of unanchored windows on the screen; otherwise, maxUnanchoredProportionalWindows is the limit, and when there are already maxUnanchoredProportionalWindows unanchored windows, an old window is removed when a new one is created.

Since maxUnanchoredProportionalWindows is an INTEGER, not a BOOLEAN, to set its value you must issue a command like:

.OmaxUnanchoredProportionalWindows 5<eol>

16.3. MAINED-Specific Options

The following options are specific to the MAINED front end:

stickyTabs
insertModeDefault
overstrikeModeDefault
lowerCaseMode
upperCaseMode
wordWrap
countPageMarksAsLines

The MAINVI front end has no front-end-specific options.

16.3.1. stickyTabs Option

The stickyTabs option, when set, attempts to preserve the position of text preceded by tab(s). By default, stickyTabs is set.

In stickyTabs mode, when non-tab characters are inserted or deleted, MAINED checks to see whether there are any tab characters to the right of the cursor. If there is more than one tab character (in the case of an insertion) or at least one tab character (in the case of a deletion), MAINED deletes or inserts one tab character for each character inserted or deleted, respectively, so as to preserve the position of the text that follows the tab character(s). If there is only one tab character, it is not deleted when a character is inserted; this prevents the text that follows the tab character from being merged with the previous text.

If a tab character is inserted or deleted, all tab characters immediately following the current cursor position are skipped before searching for tab characters to the right. Otherwise, the same algorithm is used as for the insertion or deletion of non-tab characters. See Example 16–3.

Example 16–3. How the stickyTabs Option Affects the Insertion of Tab Characters
The positions of tab characters are shown in this example by a period (.). The cursor is shown as an underline.

If a line of text looks like:

abc.....def.....ghi

then typing a tab while in insert mode results in:

abc........def..ghi

preserving the position of ghi.

When stickyTabs mode is not set, tabs act like the appropriate number of spaces.

16.4. insertModeDefault and overstrikeModeDefault Options

insertModeDefault and overstrikeModeDefault are options that set the default mode to insert or overstrike, respectively. When insertModeDefault is set, MAINED is always in insert mode. In order to issue a MAINED command, you must type <ecm>, followed by the command. The command is executed, and the mode immediately returns to insert mode. overstrikeModeDefault has a similar effect, except that overstrike mode is the default.

16.5. Case Options

When upperCaseMode is set, all inserted and overstruck characters are converted to uppercase (like a shift lock). When lowerCaseMode is set, all inserted and overstruck characters are converted to lowercase (like a lowercase shift lock).

16.6. wordWrap Option

The wordWrap option was introduced to make it unnecessary to have to type <eol> when entering new text. The default is wordWrap clear. When the wordWrap option is set, the current line is automatically broken at the last word when a line extends exactly to the right margin and a new character is inserted or overstruck at the right margin. When inserting or deleting in existing text, use the .J command to refill it.

16.7. countPageMarksAsLines Option

The countPageMarksAsLines option governs the behavior of the $G command. When countPageMarksAsLines is set, each page mark counts as a separate line in the file. For example, if a buffer contains one line, then a page mark, then another line, the command to go to the first line on the second page is 2$G when countPageMarksAsLines is clear (the default), or 3$G when countPageMarksAsLines is set.
previous   next   top   contents   index   framed top   this page unframed

MAINEDIT User's Guide, Chapter 16