Skip to main content
Nordlys logo, a drawing of two gray mountains with green northern lights in the background TIL

Back to all TILs

HOWTO Use Vim to open a file right at the line number you specify

Published on by Brie Carranza · 1 min read

Table of Contents

Show more

Sometimes, you want to open a file right at the exact line you want to edit.

You can do something like 48G to go right to line 48 but there’s a faster way. You can instead do:

vim +48 whatever.txt

That will take you right to line 48 of whatever.txt.