Vimdiff provides visual difference viewing and three-way merging within Vim.
Getting Started
Navigating Changes
| Shortcut | Description |
|---|---|
]c |
Jump to next difference |
[c |
Jump to previous difference |
Merging & Editing
| Shortcut | Description |
|---|---|
do |
Diff Obtain: Pull changes from the other window into the current buffer |
dp |
Diff Put: Push changes from current buffer into the other window |
:diffupdate |
Re-scan and re-evaluate differences across buffers |
ZQ |
Quit without saving or checking changes |
Fold Management in Diffs
| Shortcut | Description |
|---|---|
zo / zO |
Open current fold / open recursively |
zc / zC |
Close current fold / close recursively |
za / zA |
Toggle current fold / toggle recursively |
zv |
Expand folds revealing the cursor position |
zM |
Close all folds across the buffer |
zR |
Open all folds across the buffer |
zm |
Increase fold level (fold more) |
zr |
Decrease fold level (fold less) |
zx |
Re-apply folding rules |