Shortcut

Vim Save and Quit Shortcut

The Vim shortcut to save and quit is :wq then Enter on Windows. It's the same on Mac.

Quick Answer

Windows
:wq then Enter
Mac
:wq then Enter
Web
Not confirmed yet
VimShortcut

Save and Quit

Windows
:wq then Enter

Writes the file and closes Vim.

Learn More

How to save and quit in Vim

  1. Open Vim and go to where you want to save and quit.
  2. Press :wq then Enter on Windows or :wq then Enter on Mac.

Vim Save and Quit Shortcut for Windows

Press :wq then Enter.

Vim Save and Quit Shortcut for Mac

Press :wq then Enter.

Vim Save and Quit 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 save and quit shortcut?

On Windows, press :wq then Enter. On a Mac, press :wq then Enter.

Is there a Mac shortcut to save and quit in Vim?

Yes: :wq then Enter.

Does it work in Vim for the web?

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

Official source · How we verify