Skip to Content
Learning the vi and Vim Editors, 7th Edition
book

Learning the vi and Vim Editors, 7th Edition

by Arnold Robbins, Elbert Hannah, Linda Lamb
July 2008
Beginner
492 pages
16h
English
O'Reilly Media, Inc.
Content preview from Learning the vi and Vim Editors, 7th Edition

Editing Binary Files

Officially, Vim, like vi, is a text editor. But in pinch, Vim also lets you edit files containing data that is normally unreadable by humans.

Why would you ever want to edit a binary file? Aren’t binary files binary for a reason? Aren’t binary files typically generated by some application in a well-defined and specific format?

Warning

While we enjoy Vim’s binary editing feature, we do not present an in-depth discussion about potential serious issues to consider while editing binary files. For example, some binary files contain digital signatures or checksums to ensure file integrity. Editing these files risks damaging their integrity and could render them unusable. Therefore, do not consider this an endorsement of casual binary edits.

It’s true that binary files are typically created by a computerized or analog process and are not intended to be edited manually. For example, digital cameras often store pictures in JPEG format, a compressed binary format for digital pictures. These are binary, but they have well-defined sections or blocks where standard information is stored (that is, they do if they’re implemented according to specification). Digital pictures in JPEG format store picture meta-information (time of picture, resolution, camera settings, date, etc.) in reserved blocks separate from the compressed digital picture data. A practical application might use Vim’s binary file editing feature to edit a directory of JPEG pictures to change all of the year fields ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning the vi and Vim Editors, 8th Edition

Learning the vi and Vim Editors, 8th Edition

Arnold Robbins, Elbert Hannah
Vim Masterclass

Vim Masterclass

Jason Cannon
Mastering Vim

Mastering Vim

Ruslan Osipov

Publisher Resources

ISBN: 9780596529833Errata Page