Learning Vim: Day 3



Insertion and Deletion

Insertion

Keys to type What they do
a appends text after the cursor
A appends text at the end of the current line
i inserts text before the cursor
I inserts text at the begining of the current line
o opens up a new line below the cursor and inserts text
O opens up a new line above the cursor and inserts text

Deletion

Keys to type What they do
(n)x deletes characters under and after the cursor. Here n is an integer. For instance, when n is 1, you type x (or 1x), then only the character under the cursor will be deleted. If you type 4x, then four characters (the character under the cursor and three characters that follow) will be deleted
D deletes from the character under the cursor until the end of the line
(n)dw deletes the word on which the is cursor placed
(n)dd deletes the current line. Here n is an integer. For instance, when n is 1, you type dd (or 1dd), then only the current line under the cursor will be deleted. If you type 4dd, then four lines (the current line under the cursor and three lines that follow) will be deleted