Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is VimDiff so limited? [closed]

Tags:

vim

vimdiff

With all the advanced editing capabilities of Vim, I find it hard to believe that VimDiff doesn't have a way of copying from/to right/left!! What else can a difftool be used for? Any idea? What are the capabilities of VimDiff?

Also, I don't even see a way of moving to the next/prev difference!!

like image 224
Rafid Avatar asked Mar 22 '26 18:03

Rafid


2 Answers

Every thing is explained in the help ... (do, dp, ]c, [c)

:h diff

:h :h is also your friend.

like image 97
Luc Hermitte Avatar answered Mar 24 '26 11:03

Luc Hermitte


You need to use do and dp for your copying needs; these represent 'put' from current window, and 'obtain' from the other window. (This assumes a dual-split diff.)

For moving to next/prev difference, use ]c and [c .

Here are the basic commands I use, with mnemonics where possible:

dp - 'put' the changes from the current window into the other window.
do - 'obtain' the changes from other window.
]c - Go to change after (ending/next bracket) -- move to the next difference.
[c - Go to change before(opening/previous bracket) -- move to the previous diff.
zo - 'open' a section of folded text.
zc - 'close' a foldable text section.
Ctrl-W+Ctrl W - (That's ^W twice.) Jump to the other window.
:diffupdate - updates diff based on changes .
like image 21
belacqua Avatar answered Mar 24 '26 13:03

belacqua



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!