You can execute commands after Vim startup by passing them via -c
:
$ gvim -c '%!xxd' file.bin
This can even be simplified so that when Vim is started in binary mode (-b
argument), it'll automatically convert the file. Put the following into your ~/.vimrc
:
if &binary
%!xxd
endif
and start with:
$ gvim -b file.bin
Also have a look at the hexman.vim - Simpler Hex viewing and editing plugin; it makes it easier to deal with hexdumps.