An idea for an evil prank on your Vim-loving friend.
TL;DR: in most other editors same effect is achieved by the following sequence:
I noticed that there are quite few posts on the Internet about ggdGZZ (or ggdG:wq!, which is effectively the same). As a second-time Vim newcomer, I feel obliged to make a post about it. Command explanation:
ggdG clears current buffer:
- gg — go to first line
- d — delete to...
- G — last line
- :wq! or ZZ saves current buffer and closes it, leaving no way to undo.
Pro Tip: don't use <Caps Lock> button to start writing capital letters — some nerds like to remap it to something else.
Super-pro tip: if you're Pro Vim user having Vim newbie nearby, use ggg?G on him, optionally followed by ZZ. It's much less destructible — same command returns text back to readable form.