Course Lessons
Free Trial: 5 lessons remaining
Unlock Full Access
Jumping to File Positions
Estimated time: 10 minutes
Task Instructions
Master file position jumping with gg and G commands
Use 'gg' to jump to the beginning of the file and 'G' to jump to the end of the file. Practice jumping between these positions.
Learning objectives
- Master gg and G commands for file navigation
- Understand file position jumping
- Practice efficient file traversal
vim
Jump to the beginning of this file and then to the end.
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10
This is the last line.
vim
Jump to the beginning of this file and then to the end.
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10
This is the last line.
Helpful commands:
Command | Description |
---|---|
gg | Go to beginning of file |
G | Go to end of file |
:n | Go to line n |
Hints
- gg = go to beginning, G = go to end
- You can also use :1 for first line and :$ for last line
Jump to the beginning of this file and then to the end.
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10
This is the last line.