Contents
Introduction
This document is intended to provide you with the basic
information you need to use the pico text editor on the
Office of Information (OIT) Computer Lab UNIX
account. This document assumes
that you are using your account from some kind of terminal
window - either by connecting from
home, or using a Macintosh or PC in a computer lab, or in an
University office or by using a
terminal window generated by the "xterm" program on a UNIX/Linux
workstation. Information on
how to connect to the OIT host computers with a terminal program
is available on-line
at
http://www.helpdesk.umd.edu/topics/applications/terminal/.
Note: Access to the OIT Computer Labs at the
University is restricted, therefore, You must have a valid
Directory ID to use the labs.
Why Use Pico?
When using your UNIX account, you will find that there are
three popular editing tools
available for creating or modifying text files: vi,
emacs, and pico. For
more information on vi and emacs refer to Using the Vi Text
Editor and Using
the Emacs Text Editor. Unlike vi or
emacs, the pico
display-oriented text editor was developed for the sake of
"simplicity in editing".
Pico (for PIne COmposer) was developed from the UNIX
emacs editor and designed
for use with the pine mail system. So, anything you learn
about pico will also
serve as a foundation for your use of the pine
mailer. Both pico and pine
tend to document themselves; however, this document intends to
summarize as well as elaborate on
the basic features of pico.
The pico editor is not only best utilized with the
PINE mail system but it is
also the easiest editor to use when you want to edit the files on
your account. When using your
account, you can set up a default editor for use with programs
(such as the newsreader
tin) in which you need to create or modify text. For more
information on making
pico your default editor, see the Making Pico
Your Default Editor
section of this document.
Note: For more information about using UNIX,
refer to Getting
Started With your TerpConnect or Grace UNIX Account.
Conventions Used in this Document
In this document the word current, when used in
reference to some unit of text, refers
to where the cursor is - e.g., current position, current line,
word, or character. This document
also uses several different fonts to help clarify the meaning of
the text.
|
bold fixed text
|
Bold fixed text indicates words or
characters you type in.
|
|
italic text
|
Italic text is used as a general
word or phrase for which you must
substitute a specific example
(e.g., for file name you might substitute
myfile).
|
|
bold text
|
Used to place emphasis on text.
|
When referring to pressing the Enter or Return
key on the keyboard, we'll simply
say "press Enter".
Note: UNIX is case-sensitive. This means it
does make a difference whether you
type commands and filenames in upper or lower case.
Starting Pico
To edit a file with pico, type any of the following
at the UNIX system
prompt:
|
pico
|
creates a new, unnamed file
|
|
pico
filename
|
allows you to edit an existing
file or create a new file named
filename
|
|
pico -v
filename
|
opens filename to view only; no
editing allowed
|
Note: Pico, unlike UNIX, is not
case-sensitive; it does not make a
difference whether commands are typed in upper or lower
case.
When you enter pico, a window display will appear, as
illustrated below:
The pico window display is divided into four main
areas: Status Line, File
Content, Message Line, and Command List.
Status Line
The Status Line shows pico's version number, the
current
file being edited, and information pertinent to the status of the
file (or text) during your edit
session.
File "Content"
The File Content area is used to enter the text for the
file you are creating or
modifying. When you enter text in this area, you don't need to
press Enter at
the end of the line. Pico has a word wrap feature, similar
to a word processor. When you approach the end of a line, and the word
you are typing goes beyond pico's right margin, that
word will automatically shift down to the next line. This feature
also works if
you insert text into a line. The text following the inserted text
will push past the right
margin and wrap to the next line.
Message Line
The Message Line is located below the File
Content area. This line
reports system messages to you and, when needed, is for
keyboard input.
Command List
At the bottom of the screen is the Command List that
displays a menu of commands from
which to select. This is the main menu; through some commands,
you will be able to access submenus.
Commands are invoked by what pico considers to be
special control-key
sequences. A control-key sequence is when the control key,
represented by a caret (^),
is used in combination with a letter (e.g., ^G). So the
Control-G key combination
is indicated on the menu as ^G. Be sure to hold down the
control key while you type
G. Note that on some systems certain control-key sequences
are diverted before reaching
pico and you may be unable to use them. There
is an optional way, however, to issue
pico commands: you can press the Escape key twice
(i.e., Esc Esc) followed
by a letter. For example, instead of using ^C, you would
use Esc Esc C.
Note: There is no case sensitivity in a
pico control
sequence: Control-G (^G) will work the same as
Control-g (^g).
Getting Help
^G (Get Help)
The ^G (Get Help) command gives you a list of
pico commands. The help
information in pico mentions using "F" function keys
for certain commands. This is not referring to the function keys on the
computer that you're using to connect to your UNIX system and therefore
will not perform the functions mentioned.
Another feature of pico is its context-sensitive
help. When you access the main
menu and any submenus, you will find help for the feature you are
accessing. For example, when
you use the ^O (WriteOut) command, you will notice that the
command list at the bottom of
your screen will display the ^G (Help) command. Now when
you press ^G, you will
receive help on the ^O (WriteOut) command.
Moving Around Within The File
You can use the arrow keys on your keyboard to move the cursor
in the usual way (right, left, up, down). There are also pico
commands available that will enable you to move the cursor:
|
^F
|
move Forward a character (or right
arrow)
|
|
^B
|
move Backward a character (or left
arrow)
|
|
^P
|
move to the Previous line (or up
arrow)
|
|
^N
|
move to the Next line (or down
arrow)
|
Note: If you are having problems with the cursor
(arrow) keys, you should contact the OIT
Help Desk.
You will find the commands below helpful in moving to various
positions within your text.
|
^A
|
move to the beginning of the
current line
|
|
^E
|
move to the End of the current
line
|
|
^V
|
move forward a page of text
|
|
^Y
|
move backward a page of text
|
Searching For Text
^W (Where is)
When using the ^W (Where is) command, pico allows
you to search for a string of
text. This search is not case-sensitive (i.e., searching for the
characters service or
SERVICE or Service will all result in finding the
character string "service"). Also, pico searches for the character
string regardless
of what is before or after the
characters. So, if you initiate a search for service and
you have the word services
in your file, pico will find any instance of
services as well as
service.
Your search will begin from your current position and continue
to the end of the file. If
pico can't find the character string after it reaches the
end of the file, the search
wraps around to the top of the file, continuing until it finds the
string or until it arrives
back at the initial cursor position. This is referred as the
pico "search
wrap" feature.
Note: Pico will only search for character
strings. It does not have a
search and replace or find and change feature.
Editing Text
^D (Delete)
^J (Justify)
^U (UnJustify)
^T (To Spell)
^D (Delete) is used to delete the character at the
cursor position. The
Backspace key or Delete key or Del key
(depending on your keyboard) can be
used to delete a character to the left of the cursor position.
^J (Justify) is used to justify (format) a
paragraph. Pico considers a paragraph
to be a body of text separated from another body of text by the
use of a blank line.
You should have a blank line between each paragraph. This is
important because, when you complete
a paragraph, you may find that some lines are much longer or
shorter than others due to your having
removed or added text. If you have separated your paragraphs with
blank lines, you can position
the cursor anywhere in the paragraph and type ^J
(Control-J) to reformat the
paragraph. The lines are adjusted so that they are approximately
the same length within the
73-character margins.
Pico gives you the option to unjustify a paragraph by
using ^U (UnJustify). This
command is helpful when you are dissatisfied with the results of
^J. ^U (UnJustify)
is only available for you to use immediately following
^J.
A line longer than the screen width may develop from joining
lines, or inserting and/or
deleting text within lines. Pico indicates the occurrence
of a very long line of text by
displaying a dollar sign ($) in the last position of the
line. The text for a long line
may disappear at the right edge of the screen but you can scroll
through the line by using your
arrow keys. It is not a good idea to maintain your file with long
lines and it is
suggested that you use the justify feature for text alignment.
^T (To Spell) is used to check for spelling errors in
the text of the file. When you
use spell checking, it begins to alphabetically search for
misspelled words. Pico will scan
your text for words that aren't in its dictionary, and if it finds
any, it will highlight the word
and prompt you for a replacement word. If you don't want to
change the word, just press
Enter and the word will remain unchanged. To cancel spell
checking at any time, use ^C
(Cancel).
The pico editor was designed for use with the
PINE mailer, which treats the
">" symbol as a special character. The ">" symbol
is a signal pico uses to
indicate a line of text quoted from somewhere else. Therefore, when you
run spell checking, it will not
check for misspelled words on any line that begins with the
">" symbol.
Cutting, Pasting and Copying Text
^^ (Mark)
^K (Cut)
^U (Uncut)
The Cut and Paste process allows you to remove
(cut) a body of text and place
(paste) it in a destination position. The Cut command will
cut one line of text unless you
designate a specific body of text to cut. To cut and paste one
line of text, use the following steps:
- Move your cursor to the line you wish to cut and type
^K (Cut). The line will
disappear from your screen. This line has now been placed
in a buffer (a temporary storage area).
- Move your cursor to the destination position (where
you would like to insert the text) and type ^U (Uncut) to
paste your text.
The type of "cutting" described above is limited to whole
lines. You, however, can cut more
than one line. When you use ^K successively, you will
continue to add these lines to the
contents of the buffer until you use the ^U command (i.e.,
until you paste).
If you want to cut and paste a specific block of text, use the
following steps:
- Move your cursor to the position where you would like
to begin your cut and type
^^ (Mark), i.e., Control-^. The
message line at the bottom of
the screen displays the message "[Mark Set]
" indicating that you can now begin to
specify the block of text that you want to cut. You can
cancel this operation at any time
before you do the cut by using the ^^ (Mark)
command again. When you cancel, the
status line will display the message "[Mark
Unset]".
- Move your cursor up, down, left, or right to highlight
the block of text you wish to
cut.
- After you have highlighted your block of text, type
^K (Cut) to place the text
in the pico buffer.
- Move your cursor to the destination position and type
^U (Uncut) to
paste the text.
Note: When using the Mark command, type
Control Shift 6 or type
Control ^ (depending on the communication program
you are using). If neither
works, type Esc Esc 6.
To copy text simply cut it as usual, using the ^K
command, and then immediately do
a paste (^U) to restore it. Then, move the cursor to the
new destination and type ^U
again to do a second paste. You can paste the same text as many
times are you like until the next
^K command clears and replaces the buffer's contents
or you exit from
pico.
Many Macintosh and
Windows programs also
allow their own copying and pasting (usually from the program's
Edit menu). You can copy
text from a word processor on your own computer, go to your
program and use the
Paste command from the Edit menu to paste the text
into pico. The text will
be treated as if you had just typed it into your document. All
lines (except
those that end in a "hard" return in
your word processor) will wrap nicely in pico.
File Manipulation
^R (Read File)
^O (Write Out)
^R (Read File) is used to insert (read) a specific file
from your UNIX account into your
document at the current position. Lines selected using the
^R command remain exactly as
they were in the original file from which they were read - there
is no word wrapping.
A companion to this command is ^O (Write Out) which
allows you to save your text to a
given file name on your account without exiting from
pico. The ^O command also gives you
the convenience of saving intermediate stages of your editing
session.
The Pico File Browser
^T (To Files)
When you access ^R or ^O, your command line
displays another submenu of
commands. Included is ^T (To Files), which
provides a route to a list of files, just in case you can't
remember the
name of the file you want to read in (^R) or you don't know
if the file name already exists
for the file you want to write out (^O).
^T (To Files) accesses the pico file browser as
illustrated below:
The file browser displays the files and directories available
on your UNIX account. If you
initiate the browser using the ^R command, it allows you to
use the cursor keys to
select a file to insert (or read into) your current edit
session. This insertion is based on the
position of your cursor within the file content area of your
screen. If you initiate the browser
using the ^O command, again, you can use the cursor to
select a file. When you
press Enter, however, you are asked if you want to
overwrite the
highlighted file with the file on which
you were working in your file content area. Use caution when
overwriting files.
The browser allows you to use other commands simply by entering
a letter. You can
rename (R) and search (W) for files and directories;
copy (M) and delete
(D) files; and go to (G) another directory and page
through it.
Exit and Save a File
^X (Exit)
^X (Exit) from the main menu exits and saves your
file. If you have
entered any text during your editing session, pico attempts
to save the text that has
been placed in a temporary buffer when you type ^X. If you
indicate that you want to save
the buffer contents, by typing y when prompted, pico
will then prompt you for a
file name. If the file does not exist, pico will
create it. If the file exists,
pico will prompt you to confirm that you want to overwrite
the
file with the modified
text. (To quit a file without saving changes, type
n when prompted.)
The ^X (Exit) command can also be found on certain menus
that you may enter (i.e.,
submenus); typing ^X (Exit) from within these submenus
will return you to the main
menu.
Miscellaneous Commands
^L (Layout Display) allows you to refresh your
screen. From time to time, your
screen may become distorted or garbled with unwanted
characters. ^L allows you to
"repaint" your screen for normal viewing.
^C (Cursor Position) from the main menu shows the line
number for your
current position. This information (displayed on the message
line) indicates the total
lines and characters within your file.
Making Pico Your Default Editor
Pico is the easiest editor to use
when you want to edit the files
on your account. It is also the easiest to use in other
text-entry situations, such as posting an
article to a Usenet newsgroup. To make sure your favorite
newsreader lets you use pico for
this purpose, you must make pico your default
editor. Pico is the default editor on
TerpConnect.
If you wish to make pico your default editor on a
non-TerpConnect system, you will need to edit one of the files that
controls how the account operates.
These files begin with a period (referred to as "dot" in most
UNIX documentation). The
.cshrc file is one of the most important, since it
configures many things in your account when
you log in. To make pico your default editor, add two
lines to the end of your
.cshrc file. Start by typing:
pico .cshrc
at a UNIX system prompt to enter the .cshrc file. Then,
use the arrow keys (or type
^V) to move to the end of the file. Once you are on a
blank line, use the correct spacing
and letter case to type in the following two lines:
setenv EDITOR /usr/local/bin/pico
setenv VISUAL /usr/local/bin/pico
pressing Enter at the end of each line. When you
have finished, type ^X
(Exit). When you are prompted to save the modified buffer,
type y for yes. You
will then be asked for a file name, and .cshrc will appear
as
the default. Press
Enter to accept the default file name
.cshrc. After you press
Enter, your file will be saved and you will back at
the UNIX system prompt.
This change won't take effect until the next time you log on,
unless you re-execute the
.cshrc file by typing:
source .cshrc
Note: On TerpConnect accounts, apply changes to
the
.environment file. On
other systems,
changes are typically set in the
.login or .cshrc files.
|