Archive for the ‘vi Editor’ Category


Text deletion command

November 3, 2006

x    -Deletes current character

dd    -Deletes current line

dw    -Deletes current words

d)    -Deletes the rest of the current sentence

D, d$    -Deletes from cursor to the end of line

P    -Puts back previous  deleted text


Text insertion commands

November 3, 2006

a    -Append text after cursor

A    -Appends text at the end of the line

i    -Inserts text before cursor

I    -Inserts test at the beginning of the line

o    -Opens new line below the current line for text insertion

O    -Opens new line above the current line for text insertion

DEL    -Overwrites last characters during text insertion

ESC    -Stop text insertion. All this command will be terminated with ESC key


Cursor positioning command

November 2, 2006

j     -Moves down one line in the same column

k    -Moves up one line in the same column

h    -Moves back one character

l    -Moves foward one character

Enter    -Moves to the beginning of next line

0    -Move to the beginning of current line

$    -Moves to the end of current line

SPACE    -Moves forward one character

nG    -Moves to the beginning of line n. By default it will be the last line

b    -Moves backword to the beginning of previous word

e    -Moves foward  to the end of current word

w    -Moves forward to the next word

/pattern     -Moves forward to the next occurance of pattern

?pattern     -Moves backward to the next accurance of pattern

n    -Repeats last / or ? pattern search