More on the F1 and F2 keys

The F1 and F2 keys as we have seen toggle the new line mode. While in newline mode, you may at any time go to the command area and execute any editor command or toggle any of the options. This includes setting option newline off instead of using the F1 or F2 keys as toggle switches. This method of entering new lines is different from most editors and much more flexible. You are not locked into an append-only mode.

For example, if you are entering text with option blank off and want to know where all your "real" blanks are, you can zip up to the command area, turn on option blank (b+) and zip back without leaving the newline mode. This facility allows you to write your file occasionally without exiting from newline mode. The editor always places you where you left off after your file has been written away.

Also, suppose you have 5 lines of text in your buffer and are half way through adding line 6 when you notice a typing error on line 2. You are free to move immediately to line 2 using the cursor movement keys, correct the error, and return again to where you left off on line 6.

In the section on "Appending or Inserting Lines", an example had you insert a line using the F2 key and turn the newline mode off. You then moved the cursor keys to another position and appended 2 lines using the F1 key. As you will see from the following examples it was not necessary to turn the newline mode off between the two steps. Newline mode has no effect until you type a carriage return.

Try double spacing the first few lines of the bigfile file. Move to the first line of the file by pressing the Home key. Press F1 and type a carriage return and then move to the start of the second line using the cursor movement keys. Type another carriage return and continue appending a few blank lines in this manner.

You could also try the following:

  1. Appending and inserting text lines in the file.
  2. Correcting and inserting characters in the text using the Del and Ins key.
  3. Combining steps 1 and 2 without leaving newline mode.

When leaving the newline mode using either the F1 or F2 keys, the editor will delete the last blank line. Typically when appending text users will enter their last line followed by a carriage return. This will open up an unwanted hole which the closing F1 (or F2) conveniently removes. However, for your protection this automatic delete is conditional upon the line being empty.