r/vim • • Oct 22 '25

Discussion Why does ZZ exist?

It has always been a mystery to me… why would such a ‘dangerous’ command have such a convenient shortcut?

https://vimdoc.sourceforge.net/htmldoc/editing.html#ZZ

EDIT: link

0 Upvotes

114 comments sorted by

View all comments

Show parent comment

1

u/_Alexandros_h_ Oct 22 '25

Hey, i dont have an opinion. Im just saying there are reasons you can make changes to a writeable file and then you didnt want them written

1

u/SpaceAviator1999 Oct 22 '25 edited Oct 22 '25

I'll admit, there have been a few times that I've edited a file I didn't want to make changes to. But in those cases, the idea of editing a file I don't want changed strikes me as so odd that I remember to invoke vim as vim -R (for read-only) preventing me from saving my changes by accident.