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.

Free Trial: 5 lessons remaining
Unlock Full Access
Practice Beginner 10 min

Jumping to File Positions

Navigation & Jumping

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
lesson.txt

Start

 1Jump to the beginning of this file and then to the end.
 2
 3Line 2
 4Line 3
 5Line 4
 6Line 5
 7Line 6
 8Line 7
 9Line 8
10Line 9
11Line 10
12This is the last line.

Goal

 1Jump to the beginning of this file and then to the end.
 2
 3Line 2
 4Line 3
 5Line 4
 6Line 5
 7Line 6
 8Line 7
 9Line 8
10Line 9
11Line 10
12This is the last line.

Helpful commands

gg
Go to beginning of file
G
Go to end of file
:n
Go to line n
Stuck? Peek at a hint 2 hints · try it on your own first
  • gg = go to beginning, G = go to end
  • You can also use :1 for first line and :$ for last line
vim@sandbox: ~/workspace
Save your file with :w ⏎ to unlock Submit