m 2 vim: edit bin via xxd

This commit is contained in:
makefu 2015-10-10 20:23:43 +02:00
parent f295ac8f97
commit a176ee1f2f

View File

@ -103,6 +103,19 @@ in {
endfunction
call InitBackupDir()
augroup Binary
" edit binaries in xxd-output, xxd is part of vim
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
'';