Question: what is the difference between zz and wq in vi?
Answer: 2 Answers. From Vim's documentation, :x and ZZ are equivalent; they only save the file if it has been modified, then quit Vim: Write current file, if modified, and quit (same as ":x"). ... :wq on the other hand writes the file and quits Vim (assuming proper permissions).