There are many answers like this which talk about reversing the search results in one vimbuffer.
But I am wondering if there is way to highlight matching lines only in vimdiff. Something like following: vimdiff --reverse file1 file2
and the outcome highlights matching lines and hides non-matching.
diff_hlID()
and fold away lines that have diff highlighting applied to it. Something like this::windo :set foldminlines=0 fdm=manual diffopt-=filler|:g/^/if diff_hlID(line('.'),1)|:norm! zf|endif
. However that will create single line folds even for consecutive lines, so there is room for improvements. – Christian Brabandt Jul 9 '20 at 6:38