How to Jump to a Specific Line in Vim

In edit mode, type

ngg or nG

where n is the line number you want to jump to (e.g., 25)

25gg or 25G jumps to line 25.

In command mode, type the line number n
: n

To jump directly when opening a file
vim +n FileName

Display the current cursor line
Ctrl+g

Leave a Comment

Your email address will not be published.