Shortcut

Vim Move the Current Line to the Top Shortcut

The Vim shortcut to move the current line to the top is zt on Windows. It's the same on Mac.

Quick Answer

Windows
zt
Mac
zt
Web
Not confirmed yet
VimShortcut

Move the Current Line to the Top

Windows
zt

Redraws so the line you are on sits at the top of the screen.

Learn More

How to move the current line to the top in Vim

  1. Open Vim and go to where you want to move the current line to the top.
  2. Press zt on Windows or zt on Mac.

Vim Move the Current Line to the Top Shortcut for Windows

Press zt.

Vim Move the Current Line to the Top Shortcut for Mac

Press zt.

Vim Move the Current Line to the Top 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 move the current line to the top shortcut?

On Windows, press zt. On a Mac, press zt.

Is there a Mac shortcut to move the current line to the top in Vim?

Yes: zt.

Does it work in Vim for the web?

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

Official source · How we verify