dotfiles/vim/.vim/ftdetect/bin.vim

12 lines
363 B
VimL

" vim -b : edit binary using xxd-format!
augroup Binary
au!
au BufReadPre *.bin let &bin=1
au BufReadPost *.bin if &bin | silent %!xxd
au BufReadPost *.bin set ft=xxd | endif
au BufWritePre *.bin if &bin | silent %!xxd -r
au BufWritePre *.bin endif
au BufWritePost *.bin if &bin | silent %!xxd
au BufWritePost *.bin set nomod | endif
augroup END