dotfiles

Clean dotfiles
git clone git://git.dimitrijedobrota.com/dotfiles.git
Log | Files | Refs

commit dcf9813b1a1c2acb943849ab9d4958d2ebb789b7
parent 5748605715424f8d833d2623d13bc5ed16e29f9d
author Dimitrije Dobrota <mail@dimitrijedobrota.com>
date Fri, 23 Feb 2024 09:48:42 +0000

Hex editing in vim

Diffstat:
A .xdg/config/vim/hex.vim | +++++++++++
M .xdg/config/vim/vimrc | +

2 files changed, 12 insertions(+), 0 deletions(-)


diff --git a/ .xdg/config/vim/hex.vim b/ .xdg/config/vim/hex.vim

@@ -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

diff --git a/ .xdg/config/vim/vimrc b/ .xdg/config/vim/vimrc

@@ -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