Exercise

Note: To test the other cursor keys, a file exceeding the text area must be used. To create a large file named bigfile on which you can do some experimentation with the editor, try the following:
find /bin /usr/bin | xargs -n10 echo >bigfile

Position the active cursor at the command line using the large + key and enter the command:

e bigfile

The e command deletes your current buffer and reads the file into the editor creating a new buffer. Note that the editor checks to make sure any current file you are working on has been saved before proceeding. If you get a warning, type carriage return to clear the error and use the ee command to force the editor to load the new file.

ee bigfile

Your buffer now contains too many lines to display on your screen and some lines which are too wide to display in their entirety. You have a window of n lines by m characters into your text. Try using your arrow keys to move about the current screen. If you attempt to leave the screen it will automatically scroll. If you want to move faster remember the Ctrl arrow keys step over words and the ShiftTab and CtrlTab move to the beginning and end of a line.

Two common reference points in a file are its beginning and end. Press the Home key and you will find yourself back at the first line. Press the End key and you will find yourself at the last line of your buffer. A Ctrl and the Home or End key will move you to the first or last line of your current screen respectively. This means that you have a local (to the current screenfull) home and end as well as a global home and end.

To step through the file a page at a time you can use the PgUp and PgDn keys. These keys lock up at the beginning or end of your file buffer. The cursor will be left at your defined center line which defaults to line 3. If you prefer it to be the first line or another line you can change it by entering command mode (the big + key) and typing the view center command:

vc{number}

where number is between 1 and (screen length - 2). For example, to set the defined center line to line 1 enter:

vc1

Occasionally you would like to scroll the screen up or down one line without moving the cursor from its current screen line position. This can be accomplished via the CtrlPgUp and CtrlPgDn keys.

When editing programs, one of the greatest virtues of a screen editor is its ability to give you context via its full screen display. The center "5" key on the numeric keypad is designed to aid you in this respect. If you move the cursor to any line on the screen then press the 5 key (termed the center key), your screen will be redisplayed with that line positioned at your defined center line. Try positioning the cursor on one of the lines at the bottom of the screen and press the 5 key.

We have now exhausted the supplied cursor movement keys and it is time to examine the 10 function keys in more detail. QNX Software Systems has found that the odd function keys are in general easier to type and where possible has placed the more commonly used editing keys on them.