Exercise 2. Using Power Typing
This part of the exercise covers the following subcommands: POWERINP, TOP, BOTTOM, UP, DOWN, /, the PF11 key, and the PA2 and insert mode keys.
Your second file will contain a description of the invention of
the telescope. Enter:
xedit telescop script In this file,
you will enter the data in power typing mode. Enter:
====> power In
power typing mode, you type continuously, without regard for the length
of the screen line. If you come to the end of a line and you are
in the middle of a word, just keep on typing. The cursor will move
to the beginning of the next line. Two of the words you type will
start on one line and end on the next: accidentallyand
mounted.
Now type the following data (with errors):
One day in 1608 held a lens in each hand and peered through both at once, accide
ntally discovering that two lenses placed in line would magnify an image. #He mo
unted lens at each end of a tube and invented the telescope.| Checkpoint: Your file should look like this: |
One day in 1608 held a lens in each hand and peered through both at
once, accidentally discovering that two lenses placed in line would
magnify an image.
He mounted lens at each end of a tube and invented the telescope.accidentallyand
mounted) are put back together. The second sentence starts on a new line, because you typed a pound sign (#) before it. (A pound sign, the line end character, causes the data that follows it to start on a new line.)
Obviously, the first sentence is missing some words. One way to
insert a long phrase in a line is to split the line in two. Move
the cursor under the h in held
. Press PF11, and the line is
split.
Now type:
a Dutch spectacle maker named Lippershey In
the second sentence, the word ais missing before the word
lens. Move the cursor under the l in
lens. Press PA2, and press the insert mode key. Type the word
aand press the spacebar once. The sentence has moved over to accommodate the added word. Now press Reset to take you out of insert mode.
| Checkpoint: Your file should look like this: |
One day in 1608 a Dutch spectacle maker named Lippershey
held a lens in each hand and peered through both at
once, accidentally discovering that two lenses placed in line would
magnify an image.
He mounted a lens at each end of a tube and invented the telescope. The rest of this exercise will give you practice in moving the
line pointer. If your cursor is not on the command line, press PF12
to bring it down to the command line and enter:
====> top The
new current line is the Top of File line. If you wanted to add data
at the beginning of the file in either input mode or power typing
mode, you would enter TOP, followed by either INPUT or POWER.Enter:
====> bottom The new current line is the last
line of the file. Enter:
====> up 2 The new current line
is two lines up, toward the top of file.Enter:
====> down 2 The new current line is two lines
down, toward the end of file.Now type a / (diagonal) in the prefix area of any line, like this:
====/ or this: ==/== or this: /====
When you press Enter, that line becomes the new current line.
When your file is too big to fit on one screen, you can use PF7 and PF8 (the BACKWARD and FORWARD subcommands) to scroll the screen.
Enter the following subcommand to write this file to disk or directory:
====> file