Shortcut

Vim Centre the Current Line Shortcut

The Vim shortcut to centre the current line is zz on Windows. It's the same on Mac.

Quick Answer

Windows
zz
Mac
zz
Web
Not confirmed yet
VimShortcut

Centre the Current Line

Windows
zz

Redraws so the line you are on sits in the middle of the screen.

Learn More

How to centre the current line in Vim

  1. Open Vim and go to where you want to centre the current line.
  2. Press zz on Windows or zz on Mac.

Vim Centre the Current Line Shortcut for Windows

Press zz.

Vim Centre the Current Line Shortcut for Mac

Press zz.

Vim Centre the Current Line 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 centre the current line shortcut?

On Windows, press zz. On a Mac, press zz.

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

Yes: zz.

Does it work in Vim for the web?

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

Official source · How we verify