Using the Pico Text Editor

quill pen writing

Pico is the text editor that comes with Pine. Here are some Pico commands that you may find helpful both when you're writing messages in Pine and when you're editing files outside Pine. Please note that you can't use these commands when you're simply reading a message: they apply when you Compose a message or Reply to or Forward a message.

If you want to create a file when you're not in Pico, simply go to the system prompt (% or $) and type pico, leave a space, and then type the name of the file you want to create or edit. For example, to create a file called myfile, go to the system prompt and type pico myfile and hit the Enter key.

Moving Around with Pico

^ = the control key (Ctrl)

Move to the beginning of a line: ^a

Move to the end of a line: ^e

Move forward one screen: ^v

Move back one screen: ^y

Move to the top of a document: ^w y (hold down CTL and w almost simultaneously and then quickly hit y while they're down)

Move to the bottom of a document: ^w v

Manipulating Text with Pico

Here's how to cut and paste text in Pico, and how to insert a file into a mail message or into another file:

To cut or move text, you first have to highlight the section you want to cut. Move your cursor to the place where you want to start cutting and hit ^^ (that's the Ctrl key and the caret over the 6 key); you should see a little box appear in the lower part of your screen announcing Mark Set. (If ^^ doesn't produce Mark Set, try ^6 instead. One or the other is likely to work.) Once you see Mark Set, move your cursor to the end of the passage you want to cut; as the cursor moves, the text should be highlighted. When you get to the end of the passage you want to cut or move, hit ^k and watch your highlighted passage disappear. If you want to bring it back, either in its original location or elsewhere, simply move your cursor to where you want the passage to start and hit ^u to uncut (i.e., paste) it. If you just want to delete an entire line, all you need to do is move your cursor to that line and hit ^k.

If you have a file in your home directory that you'd like to insert inside a mail message or another file, you can do so by moving your cursor to where you want to insert the new file and hitting ^r. You'll be prompted with the message File to insert from home directory:. Simply type in the name of the file. If you can't remember the file's name, hitting ^t will give you a list of the files.

If all your cutting and pasting messes up your file's appearance, you can neaten it up with ^j ("justify"). This reformats the paragraph where the cursor is positioned, closing gaping holes and making line lengths more even. WARNING: Pico will reformat all the text until it comes to a blank line or one that is indented.

Other Useful Pico Commands

To search for a word or other string of characters in a file you're editing: ^w (for "where?"). You'll be prompted (Search: ) for the string you're looking for (unlike most things in Unix, the search in pico is not case sensitive). Type in your search string and hit the Enter key. The cursor will go to the string if the string appears in your text. If you hit ^w again in the same editing session, the search prompt will automatically be set up to look for the last string you searched for (it will appear in brackets). If that's what you want, simply hit the Enter key. If you want to look for a different string, type in that string and then hit Enter.

To find out how many lines a document you're editing contains and where your cursor is in that document, hit ^c (for "count"?). You'll be told that your cursor is on line x of y lines (e.g., line 45 of 165), and you'll also be told where you are in terms of numbers of characters

To save a file and exit pico, hit ^x. If you're editing an e-mail message in Pine, you'll be asked whether you want to send the message. If you say Yes, the message will be sent. If you're editing a file (not in Pine), you'll be asked whether you want to save modified buffer?. If you say Yes, you'll be prompted for a file name. If, instead, you say No, you'll lose all the changes you've made since you last saved the file (if you've never saved it, you'll lose the entire file). If you chose ^c (for "Cancel"), your command to save will be cancelled and you'll be able to continue with your editing. To save a file without exiting from the file, hit ^o. If the file already has a name, you'll be asked whether that's the filename you want to save; hit Enter to agree to save the file under that name. You can then continue with your editing. When you want to exit from the file, hit ^x.



Last updated February 3, 1998

Please send corrections to Joan Korenman.

Return to ENGL 348 Schedule of Assignments.

Return to Joan Korenman's home page