There are a couple of tricks in vim that I keep needing to look up in my Stack Overflow favourites. The first is to save a file that needs root access when you haven’t loaded vim as root.
The second is using vim as a hex editor,
:%!xxd -g 1
and to reverse it,