Learn Buffers

Stedi is equipped with 10 different buffers which can learn up to 100 key strokes each that can be replayed with a single key. This type of feature goes under the name of `macros' in many word processors but as the learning sequence allows no real programming capability, we refrain from using this name.

To start the learning process of a learn buffer, you go to the command line and enter the command `L#' where # is a number of the buffer to which you assign the learning sequence, a number from 1 to 0 (0 standing for 10). The following up to 100 key strokes that you type after this command will be recorded in that learn buffer. You terminate the learning sequence by pressing the key Ctrl-# where # is the buffer number. Then the key strokes recorded can be played back by pressing this same key Ctrl-#. You should keep in mind that during the time a buffer is learning, all the key strokes entered have their normal effect on the text. Hence a learn buffer is useful for performing an operation which must repeated more than once or twice. In summary, the general form for filling a learn buffer is:

Now let's practice this feature by teaching learn buffer number 1 to add the character `%' to the beginning of a line before moving to the next line. This is done with the following sequence:

After this procedure for filling learn buffer 1, each time you press Ctrl-1 the string `%' will be added to the beginning of the current line. Try it. This particular learn sequence is useful when using TeX. The % in the first column signals that the whole line is to be treated as commentary to the TeX formatting program so the line will be ignored.

We will mention here a few more notes about learn buffers. A learn buffer may contain a command for playing back another learn buffer as part of its learned sequence, but in order to avoid the possibility of infinite looping, the restriction is made that a learn buffer may only call another learn buffer with a lower number than itself (0 counts as 10). For a more complete description, see the section on `learn buffers' later in the manual.

Finally note two things about learn sequences. First, that as a buffer is learning, the `:' sign on the command line changes to the number of that learn buffer to remind you which buffer is learning. Second, should you desire to stop a learn buffer while it is executing, press both shift keys at the same time.

Apart from learn sequences, stedi contains a very versatile and powerful feature for allowing keyboard redefinitions. These redefinitions can be one to many or many to one so this feature can be used in a very similar way to learn sequences, although there are some differences. The details of this feature are left for the chapter on key redefinitions later in the manual.