Hex editing in vim
Diffstat:
2 files changed, 12 insertions(+), 0 deletions(-)
@@ -0,0 +1,11 @@
" https://vi.stackexchange.com/questions/2232/how-can-i-use-vim-as-a-hex-editor
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
@@ -108,4 +108,5 @@
highlight Visual ctermfg=yellow ctermbg=gray
source <sfile>:h/clangd.vim
source <sfile>:h/gruvbox.vim
source <sfile>:h/hex.vim
source <sfile>:h/wiki.vim