diff --git a/2configs/vim.nix b/2configs/vim.nix index b71d951..02a46d2 100644 --- a/2configs/vim.nix +++ b/2configs/vim.nix @@ -103,6 +103,19 @@ in { endfunction call InitBackupDir() + augroup Binary + " edit binaries in xxd-output, xxd is part of vim + 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 + + '';