How do I only dp or do just the lines, not the entire block in Vim diff?

Posted by hobbes3 on Super User See other posts from Super User or by hobbes3
Published on 2012-03-24T16:55:54Z Indexed on 2012/03/24 17:32 UTC
Read the original article Hit count: 416

Filed under:
|

I'm currently using MacVim (Snapshot 64) "Split Diff by..." menu option.

The file is Django's my settings.py from version 1.3.1 to a fresh file from version 1.4.

(Open the image on a separate window/tab to enlarge.)

I know two basic commands

  1. do to "obtain" (and replace) a block from the other side.
  2. dp to "put" (and replace) a block to the other side.

But those two commands writes the entire block, which in MacVim is the purple highlights.

If you look at the 2nd block, you can see that from line 2 and 3 only has 2 words that are different: mysite and hobbes3. I just want to replace per line not the entire block.

So what is there a command to replace do do and dp per line as oppose to an entire block or do I have to manually type it out?

Bonus question: I noticed that once I manually edit a block, I lose the purple highlighting. How do I "refresh" the diff again to include the highlights without reopening the file?

Please try to keep the answers Vim-general as oppose to MacVim-specific. Thanks!

© Super User or respective owner

Related posts about macvim

Related posts about vimdiff