Use paragraph boundaries
The technique
dip would keep the blank line. Only blank lines make paragraphs, so code braces don't count.
Keys in this lesson
- }
- Next blank line between paragraphs.
- {
- Previous blank line between paragraphs.
- dip
- Delete the paragraph and keep the blank line.
- dap
- Delete the paragraph and a blank line.
Before this lesson: Words and operators.
More about this lesson
Edit paragraphs, which in Vim are just text between blank lines.
Vim splits paragraphs at blank lines. ip is the paragraph's text and ap also takes the blank lines after it. } moves to the blank line after the paragraph and { to the one before it. Braces and indentation in code don't count: a function or a group of imports is a paragraph when blank lines surround it.
Example
With two notes and a blank line between them, dip deletes the current note and keeps the blank line. dap deletes the blank line too.
Use Start over to try again.
Guides on this topic
Exercise 1 of 4
0keys
par 3Nothing calls legacyTotal any more. Delete the function and the blank line after it.