You can use the xxd command to transform a file in Vim to hex representation, doing
:%!xxd
: enters command-line mode, % matches whole file as a range, ! filters that range through an external command, xxd is that external shell command
Giving an output like this, this is split into octet count/line (octets per line may be changed with parameter -c on xxd command), hex representation, and text representation:
0000000: 5468 6973 2069 7320 6120 7465 7374 0a41 This is a test.A
0000010: 6e6f 7468 6572 206c 696e 650a 416e 6420 nother line.And
0000020: 7965 7420 616e 6f74 6865 720a yet another.
Once you make the changes (in the hex part), you can go back to text with -r command on xxd, so
:%!xxd -r
【 在 tgfbeta 的大作中提到: 】
: vim执行%!xxd
--
FROM 221.198.64.*