The command line

A number of the commands can be entered by typing them in on a command line. These are usually commands for which more than a minimal amount of information is needed to specify the command fully. In systems that are equipped with windows the standard solution to this problem is to select a command, perhaps through a menu using the mouse, and then to enter further information through dialog boxes. It was judged however that such an interface, however productive it is in learning for those users who are not yet very well acquainted with stedi, it would only be a hindrance for serious work. After some expertise in editing is gained, dialog boxes are rather counterproductive as one is forced to switch continuously from the mouse to the keyboard and back. Moreover dialog boxes obscure part of the text and this can be rather annoying during some operations like the replacement of a complicated string.

The command line allows the user to type in the commands that would normally be handled with a dialog box but in a part of the screen that ``isn't in the way''. The line at the bottom of the screen is called (among other things) the command line. One can enter it by pressing the <Escape> key. The cursor is then positioned at the ninth column of this line and the character at the seventh position serves as a prompt. The user may then type his command and end it by pressing the <Return> key. After this stedi will execute the command, possibly give a message, and return the cursor to the text window. Clearly this procedure is very versatile, and extremely fast for those who have some expertise in typing.

If the escape key is pressed and there has been a command issued from the command line previously, this old command will be displayed in the command line, with the cursor over the first character of this command. One can now either modify the old command or type a new command. The default typing mode in the command line is the insert mode, so whenever a new character is typed everything to the right of the cursor is moved one position to the right. When a carriage return is typed, all characters to the right of the cursor are discarded and the command executed is formed by the characters to the left of the cursor. Normal editing can be performed in the command line. It isn't possible to place a mark in the command line or to execute a search operation in it but it is possible to paste parts of a line into the command line. The commands in the command line are also entered into a history mechanism which has a fixed number of entries. The default is 8 entries. One can scroll through these entries with the up and down arrows. The buffer is `circular', i.e. after going up 9 steps one comes back to the most recent command (9 back = 1 back). There is one exception to the storing of commands in the history mechanism. If the write command is given with the <shift>-F8 key a very special line is used to ensure that the user can always write his file. This line isn't entered in the history because it should always be available. The number of entries in the history mechanism can be changed with the command

    set maxhist = number
in which `number' is the new size of the history buffer. The size of the buffer is stored in the default file when it is written with the `DW' command (see p. [*]).

It is possible to change the typing mode in the command line to the overstrike mode with the Alt-O key combination. For this the cursor has to be in the command line. Switching back to the insert mode is done with the Alt-I key combination. Pressing an incorrect key during the typing of a command can possibly generate a message which overwrites the partially typed command. The partially typed command can be restored by pressing the <Home> key or by simply continuing to type the command into the command line.

When the command to be issued is longer than the available space on the screen the command line will be scrolled horizontally. The same will occur when the cursor is moved to the edge of the active space in the command line. The number of columns over which the command is scrolled can be controled with the built in variable `mstep'. This variable can be set with the command

    set mstep = `number'
in which `number' is any resonable step size.

The variety of commands issued from the command line is rather large. An attempt has been made to keep them ordered somewhat by having the commands divided into groups that all start with a single character. This character is chosen so that it corresponds as much as possible to the name of the family. An example is `p' for printing. Stedi is not case sensitive with respect to the keywords and the options of the commands.

Before any command is executed stedi will scan the contents to see whether any variables should be substituted first. These variables all start with a $ sign so if the user needs a $ in his command he may escape it by preceding it with either a backslash (\) or an <escape> character. If the characters after the $ cannot lead to confusion (no defined variable) then there is no need to escape the $. See the chapter on variables (p. [*]).

Finally if the Ctrl-R commands is pressed, whatever command line command that was last issued is repeated. This can be a rather useful command, especially during repetitive search operations.



Subsections