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.

2/24
Free Trial: 5 lessons remaining
Unlock Full Access

Basic Undo and Redo

Estimated time: 10 minutes

Task Instructions

Master the fundamental undo (u) and redo (Ctrl-r) commands

Practice making changes to the code, then use 'u' to undo them and 'Ctrl-r' to redo. Follow the TODO items to experience how Vim's undo system works.

Learning objectives

  • Master the fundamental undo (u) and redo (Ctrl-r) commands
  • Build confidence in experimenting with commands
  • Understand Vim's change grouping

Required Keystrokes

This lesson requires you to use specific keystrokes to complete it. Your submission will be evaluated based on whether you used the required keystrokes mentioned below, rather than matching a specific output.

u
Use undo command
\<C-r\>
Use redo command (Ctrl-r)

What This Means

  • Your solution must include the required keystroke patterns
  • The order of keystrokes may matter depending on the exercise
  • You'll still need to achieve the expected output
  • This helps you practice specific Vim techniques

Helpful commands:

Command Description
u Undo last change
Ctrl-r Redo last undone change
3u Undo 3 changes

Hints

  • Remember: 'u' undoes the last change, 'Ctrl-r' redoes. You can press 'u' multiple times.
vim@sandbox: ~/workspace
Make sure to save your file with :w ⏎ before submitting!