Course Lessons
Free Trial: 5 lessons remaining
Unlock Full Access
The Magic Dot: Repeat Command
Estimated time: 10 minutes
Task Instructions
Learn the powerful dot (.) command to repeat your last change
Fix the first typo manually using 'x' to delete the extra letter, then navigate to similar typos and use '.' to repeat the deletion. This teaches the powerful pattern of 'do once, repeat many'.
Learning objectives
- Master the dot (.) command to repeat changes
- Understand how to efficiently fix repetitive patterns
- Build muscle memory for the repeat workflow
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.
\.
Use the repeat command (.)
x
Delete a character
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 |
|---|---|
| . | Repeat last change |
| x | Delete character |
| n | Go to next search match |
Hints
- The dot command (.) repeats whatever change you just made. Fix one typo, then use '.' on similar typos.
# Fix all the typos using the dot command
# Fix the first instance manually, then use '.' to repeat
def process_user_dataa():
user_namee = get_user_name()
user_emaill = get_user_email()
user_phonee = get_user_phone()
user_addresss = get_user_address()
return {
'namee': user_namee,
'emaill': user_emaill,
'phonee': user_phonee,
'addresss': user_addresss
}
# TODO:
# 1. Fix 'dataa' to 'data' on line 3
# 2. Move to 'namee' on line 4 and use 'x' to delete the extra 'e'
# 3. Move to each other double letter and press '.' to repeat the deletion