vimでバイナリダンプ

vimでバイナリファイルの内容を参照・変更できるって!!

.vimrcとして、以下の内容を設定すると、vim -b xxxxxで開いたファイルをバイナリとキャラクタで表示してくれる。

"バイナリ編集(xxd)モード(vim -b での起動、もしくは *.bin ファイルを開くと発動します)
augroup BinaryXXD
  autocmd!
  autocmd BufReadPre  *.bin let &binary =1
  autocmd BufReadPost * if &binary | silent %!xxd -g 1
  autocmd BufReadPost * set ft=xxd | endif
  autocmd BufWritePre * if &binary | %!xxd -r | endif
  autocmd BufWritePost * if &binary | silent %!xxd -g 1
  autocmd BufWritePost * set nomod | endif
augroup END

rderaさんに感謝