Learn Vim / How to Delete a Paragraph in Vim

How to Delete a Paragraph in Vim

The answerFrom anywhere inside it, press dap — delete a paragraph, including the blank line after it.

Try it on a real buffer

Delete the middle paragraph and the gap it leaves behind: move into it with 3j, select “a paragraph” with vap, then d.

The first paragraph earns its place.
It stays exactly where it is.

This middle paragraph is pure filler.
It rambles without adding anything.
Nobody will miss it when it's gone.

The final paragraph sticks the landing.

Canonical solution: 3j vap d · par: 5 keystrokes (vimgolf rules — every keypress counts).

Why it works

Paragraphs are blank-line-delimited. ip is the paragraph text only; ap includes the trailing blank line, so deleting it doesn't leave a double gap. Works from anywhere inside the paragraph.

Variations

KeysWhat it does
dapdelete the paragraph + trailing blank line
dipdelete the paragraph text only
vapselect it first, then decide
{ / }jump to previous / next paragraph boundary

Reading about keystrokes doesn't build keystrokes. Try this in a real vim buffer right now — the “Stanza surgery” mission takes about a minute.

Practice free — no signup →

Keep going