What is the keyboard shortcut to go to the end of the file in vi?

19,433

Solution 1

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

See vi cheat sheet, for example.

Solution 2

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

Solution 3

Type vimtutor or inside the editor :help

Share:
19,433

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin over 1 year

    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?

  • Keith
    Keith over 11 years
    And to get back to the beginning use gg.