dotfiles

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

commit ab11c9ca71ea3c575238d5d22fa4165285b1b371
parent c1648be3edecf6b2d122a242c37e787233709d8f
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 | 11+++++++++++
M.xdg/config/vim/vimrc | 1+
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