Friday, June 29, 2018

Re: Perform diff as exact line match

On Fri, Jun 29, 2018 at 6:19 AM, Joseph L. Casale <jcasale@gmail.com> wrote:
On Thursday, June 28, 2018 at 7:46:51 PM UTC-6, Tony Mechelynck wrote:
> No plugin required, provided that you have a Vim compiled with +diff
> and that the diff utility is installed and can be found on your $PATH.
>
> See ":help diff.txt"

Hi Tony,
Specifically, I need to match lines completely ignore partial differences.
I have the most recent version of vim with a diff utility, however I do not
see anything diff.txt or diffopt that allows me to specify matches must be
complete lines and not partial.

I am trying to compare collections of strings, where I am not interested in
similar items, only exact. The collections are sorted so I want to see
filler where an exact line match is not found.
 
You mean you want to find only lines added and deleted, not changed? If
that is the case, perhaps you can script it such that you skip over "changed"
highlight areas, by repeatedly traversing diffs via "]c" or "[c". This can be
achieved by using vim functions diff_hlID() and synIDattr(). I had posted a
script sometime ago that searches for the exact changed text within a 
changed line using the above logic. You can modify that to suit to your needs.

Regards,
-Arun

--
--
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:

Post a Comment