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!!
Every thing is explained in the help ... (do
, dp
, ]c
, [c
)
:h diff
:h :h
is also your friend.
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 .
精彩评论