Wednesday, October 5, 2016

Re: How to display diff only with lines that differ and not display lines that are exactly the same?

On Thursday, October 6, 2016 at 4:23:00 AM UTC+11, Igor Forca wrote:
> Diffs are displayed like:
> a) Text line from one file not available in second file is
> colored blue.
> b) Text line that is similar between files is colored pink.
> c) Text line that is exactly the same is with no background
> color.
>
> Is there some command to display only "blue" and "pink" lines
> without "no background color"?

I think the best you can do in Vim is to set the number of
context lines to zero, and fold all unchanged lines.

:set diffopt?
:set diffopt=filler,context:0

Some normal mode commands are useful:

za toggle current fold open/close
zR reveal all (open all folds)
zM minimise all (close all folds)

Using Beyond Compare can provide some benefits because you can
use it to show only the diffs, then select-all and copy only the
different lines. I haven't found a way to do that in Vim.

John

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: