Sometimes I find it useful to switch to hex mode when editing a file in vi. The command for switching is not very obvious so thought I’d share…
So, open a file in vi as usual. To switch into hex mode hit escape and type:
:%!xxdAnd when your done and want to exit from hex mode hit escape again and type:
:%!xxd -rOkay, so this isn’t actaully switching to vi’s ‘hex mode’; vi doesn’t have one. What the above actually does is to stream vi’s buffer through the external program ‘xxd’.
What are your thoughts on this post?
If you liked this post, feel free to use the share button below. It always makes me smile when I see someone enjoyed it.
Written By
Kev