Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to handle binary files in Vim

📅 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


$ vim -b foobar.bin
:%!xxd -r

Tried with: Vim 8.1 and Ubuntu 20.04