How to Move Cursor to End of File in Vim / Vi Text Editor

How to Move Cursor to End of File in Vim or Vi Text Editor
How to Move Cursor to End of File in Vim or Vi Text Editor

Move Cursor to End of File in Vim / Vi Text Editor

Vim is a popular text editor that comes preinstalled on macOS, Linux Distros and BSD Like operating systems. Vim is a free and opensource text editor available today. Whenever using Vim we often need to jump to a specific line number or end of the file. In this tutorial, you are going to learn How to Move Cursor to End of File in Vim / Vi Text Editor.

How to Jump End of the File in Vim

If you are in any other mode then press Esc to come in Normal Mode.

Now you can press G to go to the end of the file:

G

If you want to go to first line the press gg key:

gg

How to Move Cursor to Specific Line Number

If you are in any other mode then press Esc to come in Normal Mode.

It’s easy to move the cursor to a specific line number in Vim or Vi. To move the cursor to specific line number just enter the line number followed by G key:

For example, to move to line number 12 you can enter the following command:

12G

"How

Similarly to move to line number 57 you can enter the following command:

57G

You also can come to the first line by entering the following command:

1G

Conclusion

In this tutorial, you have learned How to Move Cursor to End of File in Vim / Vi Text Editor. If You have any queries regarding this please comment below.

LEAVE A REPLY

Please enter your comment!
Please enter your name here