diff options
author | makefu <github@syntax-fehler.de> | 2015-10-10 20:23:43 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2015-10-10 20:23:43 +0200 |
commit | a6de904f24e86345f703e6f6e7d318a6ba5865f0 (patch) | |
tree | 951da5bfddca1b76368e108a13a00e2831a69521 /2configs | |
parent | d411be1dd73eb7c235dedf4d214295e331769256 (diff) |
m 2 vim: edit bin via xxd
Diffstat (limited to '2configs')
-rw-r--r-- | 2configs/vim.nix | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/2configs/vim.nix b/2configs/vim.nix index b71d95148..02a46d22a 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 + + ''; |