by Devin Yang
(This article was automatically translated.)

Published - 5 years ago ( Updated - 5 years ago )

Here is a simple record of how to use Vim to edit Binary files.
Open the binary file for editing.. Here, an external command xxd is used to view the hexadecimal encoding.
The command below displays the binary file of ls in the vi editor in hexadecimal.
xxd /usr/bin/ls|vi -
Just an example, don't really change...@@
To save, use xxd -r:
:%!xxd -r > new-ls
If the file has been opened, it can also be converted to binary by the following command
:%!xxd
After modification, you can use the following command to return, and then save
:%!xxd -r

 

Tags: vim

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


vim

About vimdiff

My vimdiff cheat sheet

vim, macos

Ultisnips requires py >= 2.7 or py3 Bugfix

If you install Vim like me, will there be an error that python2.7 or python3 is required when executing the terminal, but the system obviously has python 2.7? This article explains how I fixed this issue.

config,vim

Chinese environment of Vim on Ubuntu

If Vim is set to Chinese environment, but Ubuntu is not set to zh_TW.UTF-8 during installation, how to install this environment?