From c817818569ee99df20763d250a9d0cd4eb1d59d9 Mon Sep 17 00:00:00 2001 From: Adam Hovorka Date: Thu, 12 Jul 2018 10:50:23 -0600 Subject: Add binary.vim --- base/vim/plugin/binary.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 base/vim/plugin/binary.vim (limited to 'base/vim') diff --git a/base/vim/plugin/binary.vim b/base/vim/plugin/binary.vim new file mode 100644 index 0000000..f9a850c --- /dev/null +++ b/base/vim/plugin/binary.vim @@ -0,0 +1,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 -- cgit v1.2.3-70-g09d2