Text Editors and Email

Up to this point in this book, I've made the assumption that text editing and emailing would take place in Gnome windows.

Under Gnome, to edit text you can use one of the GUI desktop environment editors, such as Gnotepad+. Netscape Messenger is available for email.

However, what if Windows-like desktop environments don't make you feel all warm and gui inside? That's okay. If you like to edit your text using a nonwindowing application, there are many good choices available.

In this section, I'll give you a brief high-level look at two of the more popular text editors available, vi and Pico, and briefly mention emacs. Which, if any, you choose to use is, of course, up to you.

One reason you might want to use text-based utilities is that you are connecting remotely and cannot use programs that require an X11 server (such as those on the Gnome desktop).

Using vi

The vi text editor is very powerful, but it's complicated to learn. If you're a vi power user, then you know already what it can do and have the ability to make it do it. Anyone else might think twice about taking the time to get up to speed with vi. Perhaps the best reason for learning vi is that the vi editor is almost certain to be present on any flavor of Unix, so if you learn vi, you can expect to be able to edit text almost anywhere.

The version of vi that ships with Red Hat Linux 6 is vim—vi improved—which is freely distributable and was primarily written by Bram Moolenaar.

You'll find some of the commonly used vi commands in Appendix A.

To start vim:

1.
At the command prompt, type vi.

2.
Press Enter.

The vim editor will open (Figure 10.27).

Figure 10.27. To use vim, type vi at the command prompt.


Tip

You can open vi with a file already loaded by including the file name in the command: for example, vi test.


Tip

You can open a number of files using a wildcard specification: for example, vi *.html. You can then move through the files that you opened by pressing the Escape key followed by : n (for next).


To add text to a vi file:

1.
With vim open, type i.

You will now be in Insert mode.

2.
Type some text. To see the text you are typing, you may have to scroll to the top of the terminal or telnet window, if you are using one (Figure 10.28).

Figure 10.28. Insert mode is used to add text in vi.


3.
When you are through entering text, press Escape to move into Command mode.

4.
Type a, to add the text after the cursor.

To save a vi file:

1.
Press Escape to enter Command mode.

2.
Type : w (for write) followed by the file name: for example, : w vitest.

Tip

To save a file that has already been named, you can just enter : w, without a file name.


To exit vi without saving:

1.
Press Escape to enter Command mode.

2.
Type : q!

Using Pico

Pico is much user friendly than vi because Pico is menu driven. You do not have to remember arcane keystroke commands or keep track of the mode you are in.

To start Pico:

1.
At the command prompt, type p i c o.

2.
Press Enter.

Pico will open.

To enter text in a Pico window:

  • Start typing. Your text will appear in the Pico window (Figure 10.29).

    Figure 10.29. Pico features an intuitive interface.


    Tip

    If you are editing configuration files, start Pico with word wrapping disabled using the –w flag: pico –w filename.

To save a Pico file:

1.
Hold down the Control key.

2.
Press O (for write out).

To exit Pico:

1.
Hold down the Control key.

2.
Press X.

The emacs text editor

Another popular choice is emacs. Red Hat Linux 6 ships with a version of this powerful program: GNU Emacs.

The emacs editor is tremendously customizable and has so many features that it could, itself, be the subject of a Visual QuickPro Guide. Notably, emacs is a good programming editor. Arguably just as powerful, emacs is a great improvement over vi. For one thing, it doesn't have vi's different modes to keep track of.


To send an email message using Linux mail:

1.
At the bash command line, type the word mail followed by the addressee. For example, type

mail [email protected]

2.
Press Enter.

3.
At the subject line, type a subject.

4.
Type the text of your message.

5.
To end the message, type a period by itself on a line (Figure 10.30).

Figure 10.30. A Unix mail message can be concluded and sent by typing a period by itself on the message's final line.


6.
Press Enter.

7.
You will be prompted for CC addressees. If there are none, press Enter.

Tip

As an alternative to sending your email with a period on a line by itself, holding down the Control key and typing D will also send email.


Pine email

Several text-based email programs ship with Red Hat Linux 6. Pine is particularly notable. This menu-driven program is intuitive and powerful.

Pine was written at the University of Washington.

Full documentation is available on-line.

To start pine, type pine at the command prompt.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.122.82