Mission 17 / 52• Basic Operators
Delete Multiple Lines
Operators compose with vertical motions too! `dj` deletes the current line plus the line below (2 lines total).
Prefixing `d` with numbers like `3dd` or combining with motions lets you wipe out entire code sections.
Multi-line deletion
- djdelete current line and the line below (2 lines total)
- dkdelete current line and the line above (2 lines total)
- dGdelete from cursor all the way to the end of the file
- dggdelete from cursor all the way to the start of the file
Press Enter to start
1function legacyModule() {2 const obsolete = true;3 console.warn("Deprecated");4 return null;5}Position on `const obsolete` and press `dj`. Both the variable and the `console.warn` disappear together.
Now it's your turn!
0 / 5 tasks complete0.0s / 18s par0 / 13 par
Practice this lesson's commands. Each task checks your technique and the result, not just your cursor position. Take your time.
Task 1: Delete all lines to bottom of file with dG.
Expected result
keep();
Show hint
Use dG.
Press Enter to start
1keep();2dropOne();3dropTwo();jkscroll•ggGtop/bottom•Tabnext example•Enterstart•qstop•Ctrl+kCtrl+jprev/next