hex.vim (409B)
1 " https://vi.stackexchange.com/questions/2232/how-can-i-use-vim-as-a-hex-editor 2 augroup Binary 3 au! 4 au BufReadPre *.bin let &bin=1 5 au BufReadPost *.bin if &bin | %!xxd 6 au BufReadPost *.bin set ft=xxd | endif 7 au BufWritePre *.bin if &bin | %!xxd -r 8 au BufWritePre *.bin endif 9 au BufWritePost *.bin if &bin | %!xxd 10 au BufWritePost *.bin set nomod | endif 11 augroup END