normal·mode
~ / operators / line-shortcutslesson 2/7

Line shortcuts: dd, cc, D, C, J and friends

Doubled operators act on whole lines; capitals run to the end of the line.

4 drills

  1. Delete a whole line: Remove the debugging line the cursor is on. The cursor is mid-line; you don't need to move.
  2. Rewrite the rest of the line: Replace everything from the cursor to the end of the line with the new text.
  3. Retype a line, keep its indent: Replace the whole line the cursor is on with the target text, keeping its indentation.
  4. Join wrapped lines: Each statement got split over two lines. Join them back so each one sits on a single line.

The drill editor loads in your browser.

outside the editor the page is in normal mode: ? keymaps · / find · : commandsfound this useful? ☕ support it ·credits · source · not affiliated with Vim or Neovim