Is there a short cut for going back to the beginning of a file by vi editor?

user2045447 picture user2045447 · Feb 6, 2013 · Viewed 156k times · Source

When reading a long file by vi editor, it would be very nice to get back to the beginning of the file by some short cuts when you really need to do so. Even ctrl+B sometimes is too slow. Does anyone know such a tool?

Answer

Vivekanand S V picture Vivekanand S V · Feb 6, 2013

After opening a file using vi

1) You can press Shift + g to go the end of the file

and

2) Press g twice to go to the beginning of the file

NOTE : - g is case-sensitive (Thanks to @Ben for pointing it out)