On 08/05/12 03:58, doak wrote:
> I guess jumping to the next difference is what you want.
> Or do you want to jump only to the "blue" changes (which does mean new
> package)? If so I would prefer some other way like 'diff file1 file2 | grep
> "^+ "'...
If you just want to perform some action on each of the lines, I use
the following:
:g/^/if synIDattr(diff_hlID(line('.'),1), 'name') == 'DiffAdd'|#|endif
where "#" (number & print the line) is the action in this case. I
use it roughly like a ":diffdo" commmand. It gets a little uglier
if you want to act over changed lines and trickier still if you want
to act over deleted lines (usually it's easier to go to the other
diff buffer and act over the DiffAdd'ed lines).
It doesn't solve the problem of *searching* for the lines, but most
of the time if I want to find them, I also want to act on them.
-tim
--
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
Sunday, August 5, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment