Shortcut

Vim Go to a Line Number Shortcut

The Vim shortcut to go to a line number is N G on Windows. It's the same on Mac.

Quick Answer

Windows
N G
Mac
N G
Web
Not confirmed yet
VimShortcut

Go to a Line Number

Windows
N G

Type the line number first, then the command.

Learn More

How to go to a line number in Vim

  1. Open Vim and go to where you want to go to a line number.
  2. Press N G on Windows or N G on Mac.

Vim Go to a Line Number Shortcut for Windows

Press N G.

Vim Go to a Line Number Shortcut for Mac

Press N G.

Vim Go to a Line Number Shortcut for Vim Web

We haven't confirmed a Vim Web shortcut for this yet.

Related Keyboard Shortcuts

Frequently asked questions

What is the Vim go to a line number shortcut?

On Windows, press N G. On a Mac, press N G.

Is there a Mac shortcut to go to a line number in Vim?

Yes: N G.

Does it work in Vim for the web?

We haven't confirmed a web version shortcut for this yet.

Official source · How we verify