diff --git a/vim/.vim/ftdetect/bin.vim b/vim/.vim/ftdetect/bin.vim new file mode 100644 index 0000000..910744b --- /dev/null +++ b/vim/.vim/ftdetect/bin.vim @@ -0,0 +1,11 @@ +" 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