I have a couple of large json files that I need to check for errors and was wondering if it is possible to mark a difference as ok and have that apply for the whole diff session thereby eliminating it further down in the file.
example
Name: Donald Duck | Name: Daisy Duck
Here I would like to be able to mark this change as an "ok" diff (i.e. I expect the name and apparent sex change).
You can jump to the "next difference" ( ] c ), but this will jump to the next line with a difference.
Use dp for copying the current difference block to another side, do for copying from another side to the current. dp means "put", do means "obtain". The current difference block is where your caret is.
Open a terminal and run this command: vimdiff file1. txt file2. txt -c TOhtml -c 'w!
Well, the way to do it in vim, would simply to do a custom diff expression
e.g. this should go in your .vimrc
set diffexpr=MyDiff()
function! MyDiff()
let opt = ""
if &diffopt =~ "icase"
let opt = opt . "-i "
endif
if &diffopt =~ "iwhite"
let opt = opt . "-Ewb "
endif
silent execute "!diff -I 'Duck' " . opt . v:fname_in . " " . v:fname_new .
\ " > " . v:fname_out
endfunction
Of course, you'd want to make it more flexible than that, but this should give you the general method
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With