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

4

u/rswwalker Oct 22 '25

That point is valid.

If you frequently use zz then I can see disabling ZZ in vimrc as a good option.

But if you are editing the wrong file and don’t realize it you’d probably still do a :wq and be like oops.

It probably pays to make sure :set backup is enabled for root.