Monday, November 10, 2008

Vim - File Differences with vimdiff

Brief usage of vimdiff. For detailed description see man, info and online docs.

Start vim in diff mode
vimdiff file1.php file1.php~

Alternatives:
gvimdiff
vimdiff -O ==horizontal windows
vim -d

Switch between windows
Ctrl+w Ctrl+w

Put new lines to other window
dp

Obtain new lines (from another window)
do

Skip between diff groups
previous group
[c

next group
]c

(Un)folding
open folded difference
zo

close folded diff
zc

Source: vimdoc

No comments: