Text Editors on Grove
 
Grove homepage
 

What is a text editor?

A text editor is a program for creating and modifying files containing ordinary text. Text editors don't usually have features for formatting output to create papers or documents so they're not word processors. Some uses of a text editor include:

  • creating and modifying program source files for compilation
  • creating and modifying html files to use in a Web page
  • creating and modifying other files used as input to other programs

The text editors that are available on grove, the CIRCA Unix system, are pico, joe, vi, and emacs. All of these editors are full-screen editors, but they will only work correctly if used with the proper terminal type. If you are using a PC or Macintosh from home, your terminal emulation software should emulate a VT100 terminal.

Using the control key

You'll need to know how to use the control key. The control key is usually labeled Ctrl on your keyboard and is used like a shift key. You hold down the control key and then press some other key on the keyboard. There are several short-hand methods used to show a control key in help screens or in documentation. Some of the ways to show "control x" include:

  • Ctrl/X
  • Ctrl-X
  • C-X
  • ^X

Usually, upper case and lower case are not the same in Unix; however, when you use the control key, the other key pressed can be either upper or lower case. Ctrl/X and Ctrl/x are the same thing. The examples are shown in upper case because it's easier to distinguish one letter from another.

The Pico Editor

The Pine Composer (pico) is the simplest text editor to use. If you've used the pine mail program to send electronic mail, you've already used pico. Enter this command to create or modify a file using pico: pico filename.

You can't get lost in pico if you look at the bottom of the screen. You'll always see a summary of available commands or a question that pico is asking you. You should be able to use your cursor keys to move around in the file. If they don't work there are control keys to do the same thing.

Important pico commands:
^Gdisplay help screen
^Xexit from pico
Pico commands to move around in the file:
^Vscroll forward one page
^Yscroll backward one page
^Pmove to previous line
^Nmove to next line
^Emove to the end of the line
^Amove to the beginning of the line
^Wsearch for text
Pico commands to delete text:
^Ddelete character under cursor
^K"cut" current line under cursor
^Urestore the cut line at the cursor position
Pico commands to manipulate blocks of text:
^^mark start of text to select
(yes, that's Ctrl-^)
^Kcut selected text
^Uuncut or paste selected text

The Joe Editor

Joe's Own Editor (joe) is almost as easy to use as pico but has many more features. Enter this command to create or modify a file using joe: joe filename.

joe is based on the control keys used in Wordstar and Borland's programming editors. Many joe commands are invoked by typing Ctrl/k followed by another key. Here are some important ones:

^KHshow help screen
^KXsave file and exit
^KQquit without saving the file

Note that the second character in the sequence is not a control character. Sometimes, but not always, it will still work correctly if you hold down the control key when you type the second character.
Your cursor keys should work for moving through the file. Depending on your terminal emulation, you might also find that the Page Down and Page Up keys will scroll through the file. If these keys don't work, there are control keys that will do the same thing.

joe commands to move around in the file:
^Vscroll forward one screen
^Uscroll back one screen
^Xmove to next word
^Zmove to previous word
^Pmove to previous line
^Nmove to next line
^Emove to the end of the line
^Amove to the beginning of the line
^KUmove to the top of the file
^KVmove to the end of the file
^KLgo to a specific line number
joe commands to delete text:
^Ddelete one character
^Wdelete one word
^Ydelete one line
^_undo last delete
(Note: On some older terminals, ^_ might
not work. Try ^? instead.)
joe commands to manipulate blocks of text:
^KBmark start of block
^KKmark end of block
^KCcopy marked block to current location
^KMmove marked block to current location
^KYdelete marked block
joe commands to search for or replace text:
^KFsearch and replace
^Lsearch for next occurence of text

joe saves the previous version of a file when you edit it by putting a ~ character at the end of file name. If you change the file xyz then you'll find the new file in xyz and the old file in xyz~.
joe can also be used in modes that imitate the pico or emacs editor. For more information on joe and its features, type man joe.

The vi editor

The vi editor is one of the original Unix text editors. It can be clumsy to use but you will find it documented in almost any book on Unix. If you're accustomed to using it, it's available, but we don't recommend it for new users.
For information on using the vi editor, type man vi.

The CIRCA handout Using the vi editor describes this editor in more detail.

The emacs editor

emacs is a powerful editing environment popular with many serious Unix users. Enter this command to create or modify a file using emacs: emacs filename.

Essential emacs commands are:

^HT display emacs tutorial
^X^C exit from emacs

Type this to see the online manual page for emacs: man emacs.

The CIRCA document Using emacs on the CIRCA Unix system and the GNU Emacs Reference Card can get you started.

Last Revision: Wednesday, 24-Aug-2005 13:04:36 EDT

HUB 132, E-mail: helpdesk@ufl.edu, Phone: (352) 392-HELP (4357)

Academic Technology

University of Florida