Last Updated: February 25, 2016
·
530
· sheerun

Few ways to quit Vim

  • :q, ZQ - quit and fail if saved
  • :wq - write and quit
  • :x, ZZ - write and quit if changes has been made
  • :qa, :wqa, :xa - same as above, but for all buffers
  • :conf qa - quit all windows and prompt if not saved

2 Responses
Add your response

This is older but just noticed this post. :wq and ZZ are not the same command. ZZ does not alter the last mod time if the file isn't changed, :wq will. ZZ and :x are analogues, however.

over 1 year ago ·

@shawncplus Thank you for noticing it. I fixed the protip.

over 1 year ago ·