Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using putty to view a 30+MB file in vi on a Linux server, and I have to use PgDn to scroll to the bottom of the page. I realize I can use tail but I want to be able to move up and down the file with it open in vi. Is there not a way to go to end of file or top of file immediately using a keyboard shortcut?

share|improve this question

migrated from Jan 2 '13 at 7:56

This question came from our site for professional and enthusiast programmers.

The answer is a simple G in normal mode. That is capital G, not g.

You can also open a file and directly go to the end of it using:

vim +$ thefile
share|improve this answer
And to get back to the beginning use gg. – Keith Jan 1 '13 at 21:46

The key for the end of file is G (uppercase g).

See vi cheat sheet, for example.

share|improve this answer

Type vimtutor or inside the editor :help

share|improve this answer

You must log in to answer this question.