Last Updated: February 25, 2016
·
1.028K
· abhshkdz

Quickly Exit Vim

For most people (including me), :wq is a laborious quitting sequence. Here's an easier way:

Shift + z + z

Holding shift and pressing z twice from command mode saves the file and exits.

2 Responses
Add your response

There is also alternative command :x. ZZ shortcut is nice, but I have some written on my own:

  • ZX - mapped to :cq which quits with error (useful when dealing with Git)
  • ZA - quit all without saving (:qa)
  • ZS - quit all with saving (:xa)
over 1 year ago ·

Cool! So how does that work? What does Shift+z+z actually do in Vim?

over 1 year ago ·