Go to First Line in a File in Vim?
How Do I Go to First Line in a File in Vim? 3 4 Answers in Command Mode (Press Esc If You Are Not Sure) You Can Use: Gg, :1, 1G, or 1Gg. 2 Type "Gg" in Command...
How do I go to first line in a file in vim ?
4 Answers
In command mode (press Esc if you are not sure) you can use:
- gg,
- :1,
- 1G,
- or 1gg.
Type "gg" in command mode. This brings the cursor to the first line.
Go to first line
:1or
Ctrl + Home
Go to last line
:%or
Ctrl + End
Go to another line (f.i. 27)
:27
[Works On VIM 7.4 (2016) and 8.0 (2018)]
If you are using gvim, you could just hit Ctrl + Home to go the first line. Similarly, Ctrl + End goes to the last line.