diff --git a/vimrc b/vimrc index 6c9ee24..d0b1d0e 100644 --- a/vimrc +++ b/vimrc @@ -283,24 +283,22 @@ function! s:hex(...) else let l:args = [] end - if !exists("b:hex") + if &filetype != "xxd" silent exec '%!xxd '.join(l:args, " ") - let b:hex = 1 - let b:prev_filetype = &filetype - let &filetype = "xxd" + set filetype=xxd nnoremap i i echo "A witch turned your file into a hexadecimal toad!" else nunmap i silent exec '%!xxd -r '.join(l:args, " ") - unlet b:hex - let &filetype = b:prev_filetype - unlet b:prev_filetype + filetype detect echo "The witch turned your file back into binary data" end endfunction command! -nargs=* Hex call hex() +" === GIT STUFF === " + function! s:uncommitted(...) if a:0 let l:commit = a:1