Using the Pico Editor
(McCann)
Last Revision: September 2000


Pico (pronounced "PEE-co", according to Terry Gray of the University of Washington's Pine Information Center) is an editor that can be found on computers that run the Unix operating system and the Pine e-mail program. The lab systems have Pine, and therefore the Pico editor is available. Pico is not a very powerful text editor, but it is quite easy to use and is adequate for editing small files. Also, be aware that Pico is not popular with programmers and is not available on many computer systems. If you want to learn an editor that you can find on lots of computers, learn vi or emacs instead of Pico.

Starting: To begin editing a file with pico, you simply type "pico" followed by the file name. For example:

pico loop.pas

Pico clears the screen, displays a header at the top of the screen with the name of the file, and shows some of the common Pico editing commands at the bottom of the screen. At this point, you can simply begin typing. Pico, because it was designed to work with a mail program, will do automatic word wrapping at the end of lines, but you can press the Enter key whenever you want to start a new line.

The commands in Pico are activated by control characters. In the command list at the bottom of the screen, the "^" symbol (called a caret) is used to represent the Control (Ctrl) key on the keyboard. So, "^G" means to press and hold down the Ctrl key, press the "G" key briefly, and release both (in reverse order). Some commands can be activated by pressing the appropriate function key on the keyboard. For example, the F1 is equivalent to ^G.

Pico Commands:

^G (F1) = Display the Pico help message
^X (F2) = Exit Pico. Pico asks if you want to save the file.

arrows = The arrow keys move the cursor around the screen. ^F, ^B, ^P, and ^N can be used instead.
^F = Move the cursor forward one character (to the right)
^B = Move the cursor backward one character (to the left)
^P = Move the cursor to the previous line (up)
^N = Move the cursor to the next line (down)
^A = Move the cursor to the beginning of the line
^E = Move the cursor to the end of the line
^V (F8) = Move forward in the document by one "page" (a "page" is a little less than a screenful)
^Y (F7) = Move backward in the document by one "page"

^W = Search the file for a string of characters (Pico prompts for the string).
The search is case insensitive (that is, the strings "FOO" and "foo" are the same in the search)

^^ = [Ctrl-Shift-6] Mark the position of the cursor as the start of the block. Then move the cursor
to define the block; it will be shown in inverse color. (Do ^^ again to unselect the block.)
^K (F9) = Cut the block from the document.
^U (F10)= Paste (reinsert) the most-recently cut block at the cursor's position

^D = Delete the character under the cursor
^H = Delete the character just to the left of the cursor (^H has the same effect as the Backspace key)
^L = Refresh the display
^I = Insert a TAB character (or you can just press the TAB key)
^J = Justify the current paragraph [I'm not at all sure what this operation does!]
^T = Invoke spelling checker [Not too useful on programs!]
^C = Display cursor position (current line from top) and document size (in characters)
^R = Insert another file in this document at the cursor position
^O = Save the current text to a file without exiting Pico