Edit a file in hex using Vim

From AdminWiki

Revision as of 17:00, 12 May 2009 by Philip (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
  • To edit a binary file, start vim like so (:w and such will work like a charm then):
vim -b <file>
  • To edit a buffer in hex, use xxd this way:
:%!xxd
  • To return your buffer to normal (and make it save-able):
:%!xxd -r
  • To use xxd only for a part of your buffer, you can use your normal buffer selection methods, like visual - just omit the %.
Personal tools