Skip to content
Vim Learn
Learn/

Delete Multiple Lines

16 / 51

Basic Operators

Delete Multiple Lines

Use a count with a vertical motion to remove a block.

Counts express repetition before it happens. d2j applies one delete operation over the current line and two lines below it.

Use d{n}j, and d{n}k in the editor beside this lesson. The challenge proves it once; Practice is a timed run against the clock.

Keys in this lesson

d{n}j
Delete this line and the n lines below it
d{n}k
Delete this line and the n lines above it
All 91 keys →

Practice against the clock.

The challenge proves completion once. Practice is a timed run of 15 goals — beat par, then beat your own best time. Every completed goal saves locally.

dd

Delete the current line with dd.