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

Solution 1:

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)

Solution 2:

using :<line number> you can navigate to any line, thus :1 takes you to the first line.