DEV Community

Discussion on: How to exit Vim

Collapse
 
gypsydave5 profile image
David Wickes

Come now, we're just scratching the surface...

Given you're in command mode:

  • :wqa will write, quit all buffers (in case you have more than one)
  • :x will also save and quit
  • :ex as above
  • ZZ will save and quit
  • ZQ will just quit
  • :1,5wq will save only lines 1 to 5 and quit

There's more. A lot more. Interested? :h quit will take you to the Vim help section on quitting.

Collapse
 
jeremy profile image
Jeremy Schuurmans

Haha! Absolutely! I was hoping for comments just like this. Thank you, and keep the Vim tricks coming!