Vim lessons
Practice
Moderate
10 min
Line Navigation Precision
Task Instructions
Master beginning and end of line navigation with 0, , and $
Use line navigation commands to clean up the configuration. Use '0' to go to column 0, '^' to go to first non-blank character, and '$' to go to end of line.
Learning objectives
- Master line-based navigation commands
- Understand difference between 0 and ^
- Develop efficient line editing patterns
Required keystrokes
Your submission is checked for these keystrokes, not just the final text — so reach for the technique, not a workaround.
- 0 Use 0 to go to line beginning
- \$ Use $ to go to line end
Helpful commands
- 0
- Move to beginning of line (column 0)
- ^
- Move to first non-blank character
- $
- Move to end of line
- _
- Move to first non-blank character (alternate)
Stuck? Peek at a hint 3 hints · try it on your own first
- 0 goes to absolute beginning, ^ goes to first non-space character
- $ goes to the very end of the line
- Combine with other commands: d$ deletes to end of line
Clean up these configuration lines by navigating to specific positions:
server.host = "localhost" # Navigate to start of text (^)
port = 8080 # Navigate to absolute beginning (0)
timeout = 30 # Navigate to end of line ($)
debug = true # Clean trailing spaces at end
log_level = "info" # Fix indentation
max_connections = 100 # Add semicolon at end
cache_size = 512 # Remove extra spaces
enable_ssl = false # Align with others
Practice using 0, ^, and $ to navigate within lines.