vi

The vi editor is a great command line editor for use in telnet sessions. You can't always have a GUI to work with. Real men use vi!  You may also find 'Pico' to be an interesting editor if you have it installed.  It is closer in relation to 'Notepad' or dos 'Edit' than any other editor.  But vi is the standard.

MOVING AROUND THE SCREEN (Command Mode)

h = back space one
j = Down one line
k = Up one line
l = Forward one space
w = Moves forward a word
b = Moves backwards a word
e = Moves to the end of the word
W = Moves forward a big word
E = Moves to the end of a big word
B = Moves back a big word
) = Moves forward a sentence
( = Moves backward a sentence
} = Moves forward a paragraph
{ = Moves backward a paragraph

2. Control: (moves)

^F = Down one Screen
^B = Back one Full Screen
^U = Up half Screen
^D = Down half Screen

3. Direction based on word boundaries:

w = beginning of next word
b = " " of previous word
e = end of the current or next word

ADDING TEXT (Input mode) ***<Esc> terminates Input Mode***

a = Opens input mode immediately after the current cursor position
i = Opens input mode immediately before cursor
A = opens input mode at the beginning of the current line
I = Opens input mode at the end of the current line
o = Opens a line below current line
O = Opens line above the current line

CHANGING TEXT (Command mode)***All these commands put you in Input Mode

cc = Changes current line
C = Deletes from current cursor position to the end of the line
r = Replaces single character with the next character typed
s = Substitutes the current character with what’s typed

DELETING TEXT (Command mode)

dd = deletes one line **place a number in front for multiple deletion (4dd)**
D = deletes to the end of the line
x / X = deletes current character / deletes previous character

PASTE (Command mode)***use after the delete commands***

p = pastes buffer after the current cursor position
P = pastes buffer before the current cursor position

SEARCHING (Command mode)

/ = followed by an expression brings up first occurrence
? = followed by an expression brings up previous occurrence

SEARCHING & REPLACING **using ex within VI after a file is opened**

:1,$s/pattern1/pattern2/g
(Substitute string name for pattern1 and pattern2 equals what the change would be)
(ex. :1,$s/all/name/g è this will replace all the occurrences of all with name)