The auto-indent mode

The main purpose of the auto-indent mode is to allow automatic generation of indentation while programming. It can also be used for writing texts to govern the position of the left margin on the screen.

The auto-indent mode comes in three types. The first type is invoked with the A+ command and is the `normal' autoindent of most editors. When a new line is opened, the leading tabs and spaces are copied from the line in front of it. This mode is very useful for programming in many languages.

Some languages work with statement labels in the first few columns which makes the normal autoindent feature not so useful. Therefore a second type of auto-indent is also available which is activated with the A#+ command in which # stands for a number less than 100. In this mode the cursor goes to column # +1 in the new line and copies tabs and blanks only from that column on. All characters of the previous line that are in front of this position are ignored. The net effect is that statement labels are skipped in the auto-indent up to a given fixed position.

Finally the A# command is used for typing text files with a fixed left margin. Every time a new line is opened, the cursor is placed in column # +1 and no further indentation is attempted.

The auto-indent mode is turned off with the A- command. The mode can be inspected with the A command.



Summary of auto-indent commands:
A+ Normal auto-indent.
A#+ Auto-indent to at least column #.
A# Fixed indentation to column #.
A- Auto-indent off.
A Show auto-indent mode.


The auto-indent 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 then to the default file with the DW command. See also the chapter on default settings p. [*].