Editing Lines

Qedit 5.7 for HP-UX

Home Previous Next


Editing Lines

Suppose you want to change the date of your memo. You could do it the slow way, first deleting the line, then adding a replacement line with the new date. But instead of all that retyping, try the Modify command. Modify has a lot of power. Here's how to use it:

  1. Type M and the line number.
  2. Qedit displays the line, and you move along on the line below it by pressing the space bar.
  3. Stop at the point where you want to make your correction.
  4. Type in the change to be inserted and press Return.
  5. Qedit displays the entire corrected line for your approval. Make another correction if you want, and when satisfied, press Return again to accept the corrected line and get back to the slash prompt.

An example:

/m2.1
  2.1  DATE:  November 18, 2000
                        9        {move with the space bar}
                                 {press Return}
  2.1  DATE:  November 19, 2000  {press Return again}

Here is a partial list of special things you can do with Modify:

^B insert text Before this column
^D DELETE text from this column onward
^L add text after the LAST column in the line
^O OVERWRITE (or replace) columns
^T TRAVEL over the line without changing it
^G GOOFED. Put the line back the way it was, please

Note: The little symbol ^ is a shorthand way of saying that you hold down the Control key (on some keyboards abbreviated Ctrl) while at the same time pressing the letter. For example, ^B (or Control-B): keep the Control key down with one finger while with another, type a B. These symbols won't show up on your screen.

HP-UX reacts to certain control characters which might conflict with the Qzmodify codes. For example, control-D sends an end-of-file signal to HP-UX but is also the delete character in Qzmodify. You should use the HP-UX stty program to change the default end-of-file signal. Please see the section Control Characters and stty for more details.

This command is easy to use but awkward to describe; you'll understand how to use it much faster if you give it a try. Let's take a typical example, and modify line 5 of our memo. Begin by typing "m5" and, of course, pressing Return. Then, to replace "daily" with "every day", our first step is to delete the word. Use the space bar to move to the column under the "d" in "daily". Press ^D (you won't see anything, remember), then space across all the columns you want to delete. Don't press Return yet.

The second step is to insert the two new words. Press ^B and type "every day". Now press Return to see the line with the revisions.

Qedit lets you see your revisions and continue modifying with as many different changes as you can fit into one pass, before you press Return. In order to make changes at different locations in a line, press ^T to space over the intervening characters without disturbing them. If you goofed, press ^G instead: you'll get your original line back.

The final step is to accept the revisions by pressing Return one last time.

If your fingers are so trained to MPE's style of Modify (e.g., D for delete) that you cannot remember to use the Control key, do not despair. As with most things in Qedit, there is a configuration option to solve this problem. The command Set Mod HP instructs Qedit to accept HP-style modifies (i.e., MPE modifies such as D and I), instead of Qedit-style. See the Modify section of the Set command.


Home Previous Next