The Alt-T Toggle and Virtual Space

Before going on to the next section on reading, writing and printing files, let's learn a little more about virtual space and investigate a useful toggle command related to it. If you have not changed anything since replacing `World' with `stedi', the cursor should still be in line 5.

With the second action, the cursor has moved into virtual territory as there are no characters in column 33 of line 4. But since the cursor is tied to the screen, it does not jump back to column 2 as it might in an editor which only allows the cursor to move where there are actual characters.

Now the natural question arises, how does one know that there aren't blanks hidden in the virtual territory? Here is a command to answer that question.

This command tells you exactly where your real spaces are. It puts littledots wherever there are actual blanks in the text, but leaves blank any virtual blanks. (Tabs can also be seen in this mode - they are represented asthe character >.)

So now your program should look like this: #include${}^{\cdot}$<stdio.h>
main()
{
$^{\cdot\cdot\cdot\cdot\cdot\cdot\cdot}{}$printf("Hello stedi"\n);
}
The next logical question one might ask is this: what happens if you type a character somewhere out in the middle of the virtual territory (where the cursor is now)? After all, a line of a program is only defined by the actual characters that are in it. The answer is quite simple. The editor fills lines in with blanks where necessary in order to maintain a completely intuitive connection between the position of the cursor on the screen and the file being visually represented.

To see this at work, try the following. With the cursor in the virtual territory of line 4 and the Alt-T option on,

You will notice that the whole line is filled in with dots (blanks) from the right curly bracket `}' to the cursor and the program should now look like this: #include${}^{\cdot}$<stdio.h> main()
{ $^{\cdot\cdot\cdot\cdot\cdot\cdot\cdot\cdot\cdot\cdot\cdot
\cdot\cdot\cdot\cdot...
...t\cdot\cdot\cdot\cdot\cdot\cdot
\cdot\cdot\cdot\cdot\cdot\cdot\cdot\cdot\cdot}$
$^{\cdot \cdot \cdot \cdot \cdot \cdot \cdot}$printf("Hello stedi"\n);
}

If you are worried about having extra blanks at the ends of lines, there is a command for stripping them off. (The command also removes unnecessary blanks which occur in the field of a tab.)

This command, which is called `tab trim' is performed as follows:

For full details on this and related commands, see the chapter on `Tabs'. Finally we conclude this section with a brief summary of the most important editing commands not yet covered:
Insert and Delete Commands

Command Action
Ctrl-<Delete> deletes the line the cursor is in
Ctrl-D deletes everything in the current
  line to the right of the cursor.
<Insert> inserts a line above the cursor.
Shift-<Insert> inserts a line below the cursor.

In both instances of insert, the cursor will be repositioned at the beginning of the new line.

The editor also contains an undo function governed by the <Undo> key. This key recovers certain types of deletions which have been made.

The Undo key
(For further capabilities of the <Undo> key see the section on that subject in this manual)