Mission 43 / 52• Text Objects - Paragraphs

Delete Around Paragraph

`dap` deletes the block of code *and* the blank line following it.

This prevents leaving trailing empty lines when deleting entire functions or sections.

Delete around paragraph

  • dapdelete paragraph and the accompanying blank line
1
// Block 1
2
const x = 1;
3
4
// Block 2
5
const y = 2;

Position on `Block 1` and type `dap`. Notice the blank line is removed alongside the code.

Now it's your turn!

0 / 4 tasks complete0.0s / 15s par0 / 12 par

Practice this lesson's commands. Each task checks your technique and the result, not just your cursor position. Take your time.

Task 1: Remove the legacy paragraph and its blank separator with dap.

Expected result
// Active block
const ready = true;
Show hint

Use dap inside the legacy block.

1
// Legacy block
2
const old = true;
3
4
// Active block
5
const ready = true;
jkscroll•ggGtop/bottom•Tabnext example•Enterstart•qstop•Ctrl+kCtrl+jprev/next