Editing in PICO
You can easily edit short files using only the following keys:
- Return key: Inserts a new line in the file.
- Cursor (arrow) keys: The four arrow keys move the cursor up, down,
left and right
- Backspace/delete key: Deletes the character preceding the cursor.
Cutting text
Cutting, or deleting, text is usually a major component of any kind of
editing. PICO gives you two ways to cut text: you can cut it a character
at a time or a line at a time but, unfortunately, not a word at a time.
To delete a character, place the cursor just after the character you
want to delete and press ctrl-d. Pressing your keyboard's
delete key (some keyboards label it backspace) will delete the character
preceding the cursor.
To delete an entire line, place the cursor anywhere within the line and
press ctrl-k (for kill or cut text). The entire line will
be cut. If you change your mind about deleting the line before you delete
another one, you can press ctrl-u to bring back the line.
The restored line will be placed wherever the cursor is.
Pasting text
Since ctrl-u lets you restore a cut line wherever the cursor is, you can
use ctrl-k followed by ctrl-u to "cut and paste" text. In PICO you move
blocks of text pretty much as you would if you were using a word processing
package. You first need to mark (highlight) the text you want to move.
Then you cut it, move the cursor to where you want it inserted and paste
it.
- Position your cursor at the beginning of the first line of the text
block you want to move.
- Press ctrl-^ (ctrl-shift-6 keys).
- Move the cursor to the end of the block you want to cut. The text should
then be highlighted.
- Once the block is highlighted, press ctrl-k to cut
the text. the cursor to where you want the text placed and press ctrl-u.
The text should then appear.
Reformatting text
To justify or reformat a paragraph (fill in gaps left by starting a new
line) press ctrl-j. PICO defines paragraphs as text surrounded
by blank lines or indentation. For example, suppose you had the following
lines in your text file:
It followed her to school one week
to see what it could find,
it then learned French so well
It blew little Mary's mind.
If you were to place the cursor within the first three lines and press
ctrl-j, the text would then look like the following:
It followed her to school one week to see what it could find, it then
learned French so well
It blew little Mary's mind.
However, if you had a blank line between each line of text, pressing ctrl-j would
not affect the text.
If you don't like the result of the justified text, before you move the
cursor outside the paragraph press ctrl-u to "unjustify" the
paragraph. Once you've justified text, the ctrl-u command's
function changes from undelete to unjustify. However, when you move the
cursor from the justified paragraph, the ctrl-u command
function returns to undelete. Therefore, if you need to unjustify the paragraph,
you must do so before you move the cursor outside the paragraph.
To join lines that are separated by blank lines (in the example above
to move our "it blew little Mary's mind" so it was immediately below "it
then learned French so well") use ctrl-k to delete the
blank line and then use ctrl-j to fill the paragraph.
Trying it out: delete, undelete, and justify
Here you can practice editing the text you added to the file mary_lamb.txt.
Your file probably looks something like this:
Mary had a little lamb, its fleece was white as snow, and everywhere
that Mary went the lamb was sure to go.
It followed her to school one week
to see what it could find,
it then learned French so well
it blew little Mary's mind.
Move the last line ("it blew little Mary's mind") to the third
line
- Place the cursor on the last line.
- Press ctrl-k. The line will disappear.
- Move the cursor to the beginning of the third line.
- Press ctrl-u. The line, "it blew little Mary's mind",
should appear at the insertion point.
Make the four last lines one continuous line
- Place the cursor anywhere within the four lines.
- Press ctrl-j. The four lines should merge to one "paragraph".
Mary had a little lamb, its fleece was
white as snow, and everywhere that Mary went
the lamb was sure to go.
It followed her to school one day to
see what it could find, it then learned French
so well it blew little Mary's mind.
- Press ctrl-u to "unmerge" the last paragraph.
Go to the PICO tutorial main page.
Last modified
July 20, 2004
by cawalker
|