Skip to content

Instantly share code, notes, and snippets.

@pyropeter
Created April 4, 2018 18:20
Show Gist options
  • Save pyropeter/de604032f1f55d845600d82575b9b0fd to your computer and use it in GitHub Desktop.
Save pyropeter/de604032f1f55d845600d82575b9b0fd to your computer and use it in GitHub Desktop.
vim diff support for jadx jobf files
autocmd BufNewFile,BufRead *.jobf set diffexpr=DiffJobf()
function DiffJobf()
let expr = "s_[Cfmp]o?[0-9]{4}[a-zA-Z0-9]_FNORD_g"
let opt = ""
if &diffopt =~ "icase"
let opt = opt . "-i "
endif
if &diffopt =~ "iwhite"
let opt = opt . "-b "
endif
silent execute "!diff -a --binary " . opt .
\ "<(sed -E '" . expr . "' " . v:fname_in . ") " .
\ "<(sed -E '" . expr . "' " . v:fname_new . ") > " . v:fname_out
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment