OpenWindows Advanced User's Guide

7.7 Using vi with mailx

You can use the vi text editor to compose letters while running mailx. This gives you the capability of correcting mistakes and adding and deleting text before you send your letters. If you are not already familiar with using vi, refer to Chapter 6, Using the vi Editorfor instructions.

In the mailx program, you can use the standard vi commands for inserting, deleting, and changing text.

To write a letter with vi:

  1. Give the mailx command with an address at either the mailx prompt (&) or the command prompt ($).

  2. Type in the subject at the Subject: line. Press Return.

  3. Start vi by giving the command ~v on a new line. The vi screen will appear, representing an empty file in your /tmp directory.

  4. Use vi commands to input and edit the body of your letter.

  5. When done, quit vi with the command :wq or ZZ.

    After you quit vi, mailx displays the message (continue): here you can either add to the letter (outside vi) or send the letter by pressing Ctrl-D.