Is there a short space to go back to the beginning of the file with vi?

When reading a long file with the vi editor, it would be nice to go back to the beginning of the file with some short cuts when you really need to do this. Even ctrl + B sometimes happens too slowly. Does anyone know such a tool?

+83
vi shortcut
Feb 06 '13 at 4:14
source share
5 answers

After opening a file with vi

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

and

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

NOTE: - g is case sensitive (thanks to @Ben for specifying it)

+155
06 Feb '13 at 4:41
source share

using :<line number> you can go to any line, this way :1 will take you to the first line.

+61
Feb 06 '13 at 4:17
source share

Enter 1G and it will take you to the beginning of the file. Conversely, G will lead you to the end of the file.

+16
Jul 29 '14 at 9:53
source share
  • Shift + g ---> Go to the bottom of the file.
  • Shift + GG ---> Go to the beginning of the file.
+10
May 26 '17 at 6:31 a.m.
source share

: 1 will bring you to the first line

+6
Aug 16 '17 at 16:52
source share



All Articles