nvim: add support for hex editing

This commit is contained in:
PowerUser64 2021-09-23 17:13:45 -07:00
parent bcf4c2b2b5
commit 6f8a11cb1a

View file

@ -81,7 +81,21 @@ vim.cmd [[
vnoremap J :m '>+1<CR>gv=gv vnoremap J :m '>+1<CR>gv=gv
vnoremap K :m '<-2<CR>gv=gv vnoremap K :m '<-2<CR>gv=gv
colorscheme slate " Make vim a hex editor
" Edit *.bin files as binaries rather than text files (if your file isn't a .bin,
" make a symlink that points to it with the .bin extension and edit the symlink ;)
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
colorscheme slate
]] ]]
vim.cmd [[ vim.cmd [[