Screen Too Small

This course material requires a larger screen to properly display the terminal and editor interfaces.

Please use a tablet, laptop, or desktop computer for the best learning experience.

You can continue browsing, but the experience will be significantly limited.

Free Trial: 5 lessons remaining
Unlock Full Access
Practice Beginner 10 min

The Great Refactor

The Great Refactor: Mastery in Motion

Task Instructions

Apply all your Vim skills to refactor messy legacy code

This is a comprehensive challenge that requires you to use undo, visual mode, and text objects together to clean up legacy code. Take your time, experiment, and use undo when needed.

Learning objectives

  • Combine all learned techniques in realistic scenarios
  • Practice strategic use of undo during complex edits
  • Apply text objects and visual mode together
  • Develop professional Vim workflows

Required keystrokes

Your submission is checked for these keystrokes, not just the final text — so reach for the technique, not a workaround.

  • [cd]i[w"'()] Use text objects for editing
  • u Use undo for safety

Helpful commands

ciw
Change inner word
ci(
Change inside parentheses
V
Visual line mode
u
Undo mistakes
.
Repeat last change
Stuck? Peek at a hint 4 hints · try it on your own first
  • Use ciw to change class/method/variable names
  • Use u to undo if you make a mistake
  • Use . to repeat similar changes
  • Visual mode can help select complex names
vim@sandbox: ~/workspace
Save your file with :w ⏎ to unlock Submit