GBT OPERATIONS PROCEDURES

Number: INFO-01

Title: Common Text Editor Commands

Last Revision: 27 Feb 02

General

Some operations duties may require use of a text editor in a Unix/Linux environment. The following editors are those most commonly used.

Info

The character " ^ " is used below to emphasize spaces between dialog elements.  It's also used to denote control (Ctrl) key use. 

Pico

Pico is a simple text editor. A status line at the top of the display shows the current file being edited and whether or not there are outstanding modifications to be saved. The third line from the bottom is used to report informational messages and for additional command input. The bottom two lines list available editing commands.

To start Pico, open an xterm window and type pico. Typing pico followed by a file name will directly open the file in the editor.

In the table below, a caret " ^ " is used to denote the control key use. Example: A CTRL-q combination is shown as ^q.

The following commands are available. Function key commands are shown in parentheses.

KEY

FUNCTION

^G (F1)

Display this help text.

^F

move Forward a character.

^B

move Backward a character.

^P

move to the Previous line.

^N

move to the Next line.

^A

move to the beginning of the current line.

^E

move to the End of the current line.

^V (F8)

move forward a page of text.

^Y (F7)

move backward a page of text.

^W (F6)

Search for text, neglecting case.

^L

Refresh the display.

^D

Delete the character at the cursor position.

^^

Mark cursor position as beginning of selected text.

^K (F9)

Cut selected text.

^U (F10)

Uncut (paste) last cut text inserting it at the current cursor position.

^I

Insert a tab at the current cursor position.

^J

Format (justify) the current paragraph.

^T

Invoke spell checker.

^C

Report current cursor position.

^R

Insert an external file at the current cursor position.

^O

Output the current buffer to a file, saving it.

^X

Exit Pico, saving file.

VI

VI is a screen-based editor. The VI editor lets a user create new files or edit existing ones. To start VI, open an xterm window and type vi. Typing vi followed by a file name will directly open the file in the editor. When you start VI for the first time, you will see a screen filled with tildes (~) on the left side. The VI editor has two command modes: VI and EX. VI is what you'll use most, however EX may be required to accomplish certain tasks. Here are some common VI and EX commands: 

KEY

FUNCTION

a

Enter insert mode, characters typed will be inserted after the current cursor position. 

h

Move the cursor to the left one character. 

i

Enter insert mode, characters typed will be inserted before the current cursor position.

I

Insert from the beginning of a line.

j

Move the cursor down one line. 

k

Move the cursor up one line.

l

Move the cursor to the right one character. 

r

Replace one character under the cursor. 

u

Undo the last change to the file. Typing u again will restore the change.

x

Delete character under the cursor. 

d^

Delete from current cursor position to the beginning of the line.

d$

Delete from current cursor position to the end of the line.

p

Pastes the specified text after the cursor position.

P

Pastes the specified text before the cursor position.

-r

A recovery command, should vi die or something go wrong while you're working on a file. Only works once per failed VI session. Example use: vi ^ -r ^ filename.

ZZ

Exit the VI editor, saving if any changes were made. 

:wq

An EX command. Press Esc to get into EX mode. Typing :wq will save the file then quit

:q

An EX command. Press Esc to get into EX mode. Typing :q lets you quit, but warns if changes were made.

:q!

An EX command. Press Esc to get into EX mode. Typing :q! lets you quit without saving changes.

XEmacs

XEmacs is a windows type editor similar in many respects to those found on a PC. Many of the commonly used commands for opening, editing, and saving a file are displayed under menus at the top of the screen. As such, further description here is unnecessary. To start XEmacs, open an xterm window and type xemacs. Typing xemacs followed by a file name will directly open the file in the editor.  

Prepared by: Dave Rose

Last modified: 27Feb02