1. [Home](<https://delaparra-services.nl/>) 
1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) 
1. [gg / G (top / bottom)](<https://delaparra-services.nl/knowledge-hub/gg-g-top-bottom>)

  

Category: Keyboard shortcuts 

# gg / G (top / bottom)

  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    

## What is gg / G (top / bottom)?

 

gg / G (top / bottom): Vim: jump to the first line (gg) or the last line (G) of the file. In Vim, ` gg ` jumps to the first line of the file and ` G ` jumps to the last. A number before ` G ` jumps to that line, so ` 42G ` goes to line 42. These motions combine with operators like everything else in Vim. ` dG ` deletes from the cursor to the end of the file, ` ggVG ` selects the whole file, and ` gg=G ` re-indents all of it.

 

Definition source [Coders Lingo](<https://coderslingo.com/resources/open-dataset/>), [CC BY 4.0](<https://creativecommons.org/licenses/by/4.0/>)

 

## Frequently asked questions about gg / G (top / bottom)

  

### What should you keep in mind with gg / G (top / bottom)?

 

The same keys work in ` less `, which is what ` man ` pages and ` git log ` use for paging. When you open a long log file in ` less `, ` G ` takes you straight to the newest entries at the bottom, and ` gg ` back to the top. It is a small habit that makes reading logs on a server much quicker than scrolling.

 

## At a glance

   CategoryKeyboard shortcuts Explained by[Reinier de la Parra](<https://delaparra-services.nl/about>) UpdatedNovember 25, 2026

 

## More Keyboard shortcuts terms

 

- [Delete Previous Word](<https://delaparra-services.nl/knowledge-hub/delete-previous-word>) 
- [Extract Method / Variable](<https://delaparra-services.nl/knowledge-hub/extract-method-variable>) 
- [Format Document](<https://delaparra-services.nl/knowledge-hub/format-document>) 
- [Go to Definition](<https://delaparra-services.nl/knowledge-hub/go-to-definition>) 
- [Go to Line](<https://delaparra-services.nl/knowledge-hub/go-to-line>) 
- [Move Line Up / Down](<https://delaparra-services.nl/knowledge-hub/move-line-up-down>)

 

[All terms starting with G](<https://delaparra-services.nl/knowledge-hub#letter-g>)

 

## Skills

 

- ### Editor shortcuts (VS Code / Cursor and Vim)

 

Use when a user asks how to do something faster in VS Code (or Cursor) or Vim, asks what a keyboard shortcut does (e.g. Ctrl+D, Ctrl+Shift+P, F12, gg, dd, yy, ciw, :wq), wants to customise keybindings, or is stuck in Vim. Gives the correct shortcut for their operating system and can write keybindings.json entries.

 [View skill](<https://delaparra-services.nl/skills/editor-shortcuts>) [Download zip](<https://delaparra-services.nl/skills/editor-shortcuts/download>)

 

## Manuals

 

- [Keyboard shortcuts in VS Code and the terminal](<https://delaparra-services.nl/manuals/sneltoetsen-in-vs-code>) 
- [Installing Visual Studio Code](<https://delaparra-services.nl/manuals/visual-studio-code-installeren>)

 

## Need any help?

 

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.

  [Get in touch](<https://delaparra-services.nl/availability>)

[HTML version](https://delaparra-services.nl/knowledge-hub/gg-g-top-bottom)
