Delete Multiple Lines

In Vim, you can delete entire lines using the d command combined with line motions.

d
d
-delete the current line
Example
d
j
-delete the current line and the line below
Example
d
k
-delete the current line and the line above
Example
3
d
d
-delete 3 lines
Example







function greet(name) {
return `Hello, ${name}!`;
}
const message = greet("world");
greet();
 0/15  00:00

Tips

You can also use a count before dd to delete multiple lines. For example, 3dd will delete 3 lines.