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.

9/19
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
Before
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.
After
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
vim@sandbox: ~/workspace
Make sure to save your file with :w ⏎ before submitting!