gg VIM Command

How to use gg Command in Linux VIM editor?

Explanation


This command is used to move the cursor to first line of the file.

Usage:

gg

Example:

  • Open the file test.txt
    $ vim test.txt
  • You can view that the cursor is now focussed in the second line
    gg VIM Command
  • To move the cursor to first line of the file
    Press gg
    gg VIM Command Editor
  • To move the cursor to beginning of the second line in the file
    Press 2gg
    Move Cursor to First Line

Ask Questions

Ask Question