Text Editors

Important commands, vi editor.

Command

Description

:q! [Enter]

Exit without saving.

:wq [Enter]

Write and exit.

:wq! [Enter]

Write and exit, forces overwriting of the write-protected file.

:w filename [Enter]

Write to another file.

^L (Ctrl-L)

Redraw the screen.

^

Move to the beginning of the line.

$

Move to the end of the line.

h j k l

Move the cursor left / down / up / right / up / down (alternative to the arrow keys).

:num [Enter]

Go to line number.

G

Go to the last line.

/pattern [Enter]

Search forward for pattern.

?pattern [Enter]

Search backwards for pattern.

n

Repeat last search.

i text ESC

Insert text before the cursor position.

A text ESC

Append text after end of line.

o text ESC

Open a new line after the current one and insert text.

x

Delete the characters under the cursor.

r char

Replaces the character under the cursor with another single character.

dd

Delete entire row.

yy

Copy ("drag") the current line.

num yy

Copying number lines, starting with the current line.

p

Paste copy buffer after the current line.

Important commands, Easy Editor (ee).

Command

Description

ESC

Pop-up menu.

^C

Prompt.

^C quit [Enter]

Exit without saving.

^C exit [Enter]

Write and exit.

^C write [Enter]

Write to another file.

^A

Move to the beginning of the line.

^E

Move to the end of the line.

^C num [Enter]

Go to line number.

^Y string [Enter]

Search forward for string.

^X

Repeat last search.

^K

Delete entire row.