aboutsummaryrefslogtreecommitdiff
path: root/base/vim/plugin/binary.vim
blob: f9a850ceb242faf39f3e2a545d8f9b20e82ed866 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
" change *.bin to comma separated extension list
" vim -b : edit binary using xxd-format!
augroup Binary
  au!
  au BufReadPre  *.bin let &bin=1
  au BufReadPost *.bin if &bin | %!xxd
  au BufReadPost *.bin set ft=xxd | endif
  au BufWritePre *.bin if &bin | %!xxd -r
  au BufWritePre *.bin endif
  au BufWritePost *.bin if &bin | %!xxd
  au BufWritePost *.bin set nomod | endif
augroup END