📅 2022-Jan-06 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ binary, vim ⬩ 📚 Archive
Though Vim is primarily designed for dealing with text files, it can be used to read, view and write binary files with the help of external tools. I like the use of the xxd tool for this.
$ vim foobar.bin
:set binary
or
$ vim -b foobar.bin
:%!xxd
To edit the binary file, edit the characters on the left side of the hex dump.
To write the hex dump of the binary file:
:%!xxd -r
Tried with: Vim 8.1 and Ubuntu 20.04