Vim lessons
Practice
Advanced
10 min
File Jump Navigation Expert
Task Instructions
Master file jumping with gg, G, and line number navigation
Practice jumping to specific locations. Use :10 to jump to line 10, G to jump to the end of file, gg to jump to beginning, and :17 for line 17. These commands give you instant access to any part of the file.
Learning objectives
- Master file position jumping
- Memorize gg and G commands
- Perfect line number navigation
Required keystrokes
Your submission is checked for these keystrokes, not just the final text — so reach for the technique, not a workaround.
- gg Jump to beginning with gg
- G Jump to end with G
- :\d+ Jump to specific line number
Helpful commands
- gg
- Go to first line of file
- G
- Go to last line of file
- :n
- Go to line number n
- Ctrl+g
- Show current file position
- '
- Jump to mark
Stuck? Peek at a hint 3 hints · try it on your own first
- gg = go to first line, G = go to last line
- :n = go to line n (e.g., :25 goes to line 25)
- Ctrl+g shows your current position in the file
class DataProcessor:
"""Line 1: Class definition"""
def __init__(self):
"""Line 4: Constructor"""
self.data = []
self.errors = [] # Line 6: Check error handling
def load_data(self, filename):
"""Line 9: Load method"""
# TODO: Add validation here (Line 10)
pass
def process(self):
"""Line 14: Main processing"""
# Line 15: Processing logic goes here
for item in self.data:
# Line 17: Process each item
pass
def save_results(self):
"""Line 21: Save method"""
# Line 22: Implementation needed
pass
# Line 25: Add more methods below
def validate(self):
"""Line 28: Validation method"""
# Line 29: Check data integrity
return True
# Line 32: End of file - jump here with G
Practice: Jump to line 10, then to end (G), then beginning (gg), then line 17.