d is the delete operator. It takes a motion: dw deletes a word, d$ deletes to end of line. Doubling the operator (dd) makes it linewise. x and X are convenience deletes for single characters.
d is the delete operator. It's a verb that needs a noun. The noun is any motion or text object. dw deletes a word. d$ deletes to end of line. dip deletes the inner paragraph. The grammar carries you here.
Delete character under cursor
Key
Note
x
Delete character before cursor
Key
Note
X
Delete a word
Key
Note
d
w
Delete to end of line
Key
Note
d
$
= d$ (delete to end of line)
Key
Note
D
Delete the current line
Key
Note
d
d
x โ delete a characterX โ backspace-deletedw โ delete a wordD โ delete to end of linedd โ delete a line
Reference
Key
Action
x
Delete char under cursor
X
Delete char before cursor
d{motion}
Delete what {motion} covers
dd
Delete current line (linewise)
D
Delete to end of line (= d$)
diw
Delete inner word
dap
Delete around paragraph
{n}dd
Delete {n} lines
Worked example โ x dw dd
Three deletes, three scopes.
Step 1 ยท Cursor on 'q'.
Step 2 ยท x ยท x โ one char gone.
Step 3 ยท dw ยท dw โ through next word boundary.
Step 4 ยท dd ยท dd โ entire line.
d is the operator; x is sugar for dl. The deleted text goes to the unnamed register and the numbered register 1.